Re: [squid-users] ncsa_auth user ID is case-sensitive

From: Waitman C. Gobble, II <waitman@dont-contact.us>
Date: 05 Dec 2002 09:02:59 -0800

> On Thu, 2002-12-05 at 04:30, Tom Stanley wrote:
> > I am using ncsa_auth with squid. When I type my user ID and password
in my
> > browser, the user ID is case-sensitive. I am going to use this to
restrict
> > access for my kids, so being case-sensitive might be difficult for
them. I
> > think they will type their password exactly as I give it to them,
but they
> > probably won't be as careful with their name.
> >
> > Is there a version of ncsa_auth that is not case-sensitive? I am not
a C
> > programmer, but looking at the code, is there a way to make the
hash_lookup
> > be case-insensitive?
>
> Not trivially, but you can easily do the following:
> * make the username and password lowercase before you insert into the
> hash table.
> * Make the username and password squid gives you for checking
lowercase
> before doing the check.
>

How about this? I am no expert, and there could very well be a better
way of doing.

source file: helpers/basic_auth/NCSA/ncsa_auth.c

insert line after 42

        #include <ctype.h>

insert line after 107

        int i;

insert after line 135

        for (i=0;user[i]!='\0';i++)
        {
                user[i] = tolower(user[i]);
        }

insert after line 142

        for (i=0;passwd[i]!='\0';i++)
        {
                passwd[i] = tolower(passwd[i]);
        }

then build the thing

./configure --enable-basic-auth-helpers="NCSA" (...other options...)

make
su
make install

I didn't do the install bit or actually try it _live_, you can give it a
shot. (I gotta finish a proposal and it is getting late.) I _DID_ do the
configure and make and checked to see if there where any warnings or
errors caused by the modifications.

By the way, you could also consider teaching your kids to use usernames
and passwords properly from the get-go. Please don't get me wrong, but
my four year old son hasn't had any problem with it, we have so many
machines around here that it was prudent to create a detached login
account for him than to designate a particular machine for his use.

Take care,

-- 
Waitman Gobble         EMK Design     Buena Park, California
http://emkdesign.com   +1.7145222528   waitman@emkdesign.com
Public Key                          http://pgp.emkdesign.com
Find an example                    http://freakinexample.com

Received on Thu Dec 05 2002 - 10:03:02 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:11:52 MST