httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Barrera A." <Br...@Ivn.cl>
Subject Re: [users@httpd] case insensitive using basic authentication
Date Mon, 03 Jan 2005 18:02:34 GMT
stricmp doesnt exists in c.
The correct function is strcasecmp.

        #include <string.h>

        int strcasecmp(const char *s1, const char *s2);

        int strncasecmp(const char *s1, const char *s2, size_t n);



Yanbin Ma wrote:
> It seems nobody is interested in my previous question. Can anybody tell 
> me if I should address this to developer mail list? Thanks! 
>  
> Yanbin
> 
>     ----- Original Message -----
>     *From:* Yanbin Ma <mailto:yma@competitrack.com>
>     *To:* users@httpd.apache.org <mailto:users@httpd.apache.org>
>     *Sent:* Sunday, January 02, 2005 11:05 PM
>     *Subject:* [users@httpd] case insensitive using basic authentication
> 
>     Hi,
>      
>     I have recently moved one of our server from a netscape suitespot
>     V3.5 to apache 2.0. Finishing this was a miracle, considering I am
>     new to apache and my tight schedule in the last month. However, I am
>     facing one (hopefully last) difficulty here:
>      
>     The Netscape server uses a case insenstive DBM based basic
>     authentication. After I switched to apache, I chose to use file
>     based basic authentication. (again, because of the schedule,
>     otherwise, I would go a longer way and setup some database/dbm based
>     solution). However, I found mod_auth in apache 2.0 searches the
>     password file in a case sensitive way. So I thought since I have all
>     the apache source code, why don't I make a custom mod_auth to search
>     the file in case insensitive way.
>      
>     So I changed mod_auth.c, it was a simple one line change ( from
>     strcmp() to stricmp()), then rebuilt the apache. However, the newly
>     built version cannot be started because "mod_auth cannot be loaded".
>     I thought maybe stricmp() is not a popular function, so I changed
>     the code again so that it does something like below:
>         int i;
>      
>         ....
>      
>         for (i=0;i<strlen(user_str);i++) {
>            if (user_str[i] >='A' && user_str[i]<='Z') {
>               user_str[i]  += ('a' - 'A');
>            }
>         }
>      
>         if (!strcmp(user_str, str_in_the_file))
>      
>     However, it still does not work. I am sure it's not syntax error,
>     otherwise I would have failed the build. But I can not figure out
>     what else I need to do in addition to change the code and rebuild.
>      
>     Did anybody have experience in this?
>      
>     Regards,
>     Yanbin Ma

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message