RE: transform capital letters in usernames?

From: Chemolli Francesco (USI) <ChemolliF@dont-contact.us>
Date: Wed, 12 Jul 2000 13:49:27 +0200

> hmm, i talked with the programmer who made smb_auth: changing
> anything there
> wouldn't help as squid expects a authprogramm to only answer
> 'OK', so all he
> could do would be make smb_auth not accept usernames in
> capital letters, but
> that wouldn't get me further: wether smb_auth doesn't accept
> them or squid
> is case-sensitive, the result is the same: the user gets an
> access denied
> and wonders why.
>
> Therefore it would have to be done in Squid. There should be
> a possiblity to
> make it case-insensitive when it comes to usernames (or maybe
> even accept
> regex, though i doubt there is much use for that).
> Unfortunately i am not
> very good at C (which i suspect squid has been written in).

To address this problem I patched the acl.c file.
Using an hack to address the issue would be quite simple, I am not
sure whether it would be appropriately "clean".

The (untested) hack I am talking about would be something along the lines of
(in acl.c):

static int
aclMatchUser(wordlist * data, const char *user)
{
 int cis=0; /* set to 1 for case-insensitive usernames */
/* changed here */
 if (user == NULL)
  return 0;
 debug(28, 3) ("aclMatchUser: checking '%s'\n", user);
 while (data) {
  debug(28, 3) ("aclMatchUser: looking for '%s'\n", data->key);
  if (strcmp(data->key,"-i") == 0) {
   debug(28, 3) ("aclMatchUser: going case-insensitive\n");
   cis=1;
  }
  if (strcmp(data->key, "REQUIRED") == 0 && *user != '\0' && strcmp(user,
"-") != 0)
   return 1;
  if ((cis == 0 && strcmp(data->key, user) == 0) ||
strcasecmp(data->key,user) == 0) /* changed here */
   return 1;
  data = data->next;
 }
 return 0;
}
Received on Wed Jul 12 2000 - 05:46:32 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:54:30 MST