Menu

#5 Patch for case-insensitive username checking.

open
nobody
None
5
2006-03-01
2006-03-01
Anonymous
No

We use mod_ntlm2 with groups in .htaccess files. This
leads to the situation where the usernames needs to be
in all combinations of cases in the group-file.

The patch changes the user-name to be in lower-case all
the time, thus it is only nessesary to have the
username in lowercase in the groups.

diff -Nur mod_ntlm2-0.1/mod_ntlm.c
mod_ntlm2-0.1-mod/mod_ntlm.c
--- mod_ntlm2-0.1/mod_ntlm.c 2003-02-23
16:58:02.000000000 +0100
+++ mod_ntlm2-0.1-mod/mod_ntlm.c 2006-03-01
09:06:13.000000000 +0100
@@ -522,6 +522,12 @@
/* silently accept login with same
credentials */
r->user = apr_pstrdup(r->connection->pool,
ntlm_connection->user);
+
+ char *user= r->user;
+ while(*user){
+ *user = tolower(*user);
+ user++;
+ }
r->ap_auth_type =
apr_pstrdup(r->connection->pool,
NTLM_AUTH_NAME);
return OK;
@@ -557,6 +563,11 @@
* NULL; */
r->user = apr_pstrdup(r->connection->pool,
ntlm_connection->user);
+ char *user= r->user;
+ while(*user){
+ *user = tolower(*user);
+ user++;
+ }
r->ap_auth_type = apr_pstrdup(r->connection->pool,
NTLM_AUTH_NAME);

@@ -664,6 +675,11 @@
* connection. The other allocations are temporary
and can be
* tossed away any time. */
r->user = apr_pstrcat(r->connection->pool,
sent_user, NULL);
+ char *user= r->user;
+ while(*user){
+ *user = tolower(*user);
+ user++;
+ }
r->ap_auth_type = "Basic";

Btw: mod_ntlm2 does not compile with gcc4

Email: jesper@krogh.cc

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.