diff -ur squid/include/splay.h squid-splay_acls/include/splay.h --- squid/include/splay.h Thu Aug 3 11:28:36 2000 +++ squid-splay_acls/include/splay.h Thu Oct 12 15:59:03 2000 @@ -2,6 +2,8 @@ * $Id: splay.h,v 1.1.1.2.10.1 2000/04/17 00:13:08 hno Exp $ */ +#ifndef _SPLAY_H +#define _SPLAY_H typedef struct _splay_node { void *data; @@ -19,3 +21,5 @@ extern splayNode *splay_splay(const void *, splayNode *, SPLAYCMP *); extern void splay_destroy(splayNode *, SPLAYFREE *); extern void splay_walk(splayNode *, SPLAYWALKEE *, void *); + +#endif /* _SPLAY_H */ diff -ur squid/ntlm_auth_modules/NTLMSSP/CVS/Entries squid-splay_acls/ntlm_auth_modules/NTLMSSP/CVS/Entries --- squid/ntlm_auth_modules/NTLMSSP/CVS/Entries Thu Oct 12 15:33:43 2000 +++ squid-splay_acls/ntlm_auth_modules/NTLMSSP/CVS/Entries Thu Oct 12 13:24:30 2000 @@ -2,4 +2,4 @@ /Makefile.in/1.1.2.3/Fri Aug 4 08:10:21 2000//Tntlm /libntlmssp.c/1.1.2.12/Tue Oct 10 15:31:03 2000//Tntlm /ntlm.h/1.1.2.12/Tue Oct 10 15:31:04 2000//Tntlm -/ntlm_auth.c/1.1.2.9/Thu Oct 12 13:33:43 2000//Tntlm +/ntlm_auth.c/1.1.2.9/Tue Oct 10 16:49:45 2000//Tntlm diff -ur squid/src/acl.c squid-splay_acls/src/acl.c --- squid/src/acl.c Tue Oct 10 10:18:29 2000 +++ squid-splay_acls/src/acl.c Thu Oct 12 17:13:06 2000 @@ -60,7 +60,7 @@ static int aclMatchAcl(struct _acl *, aclCheck_t *); static int aclMatchIntegerRange(intrange * data, int i); static int aclMatchTime(acl_time_data * data, time_t when); -static int aclMatchUser(wordlist * data, const char *ident); +static int aclMatchUser(void *dataptr, const char *ident); static int aclMatchIp(void *dataptr, struct in_addr c); static int aclMatchDomainList(void *dataptr, const char *); static int aclMatchIntegerRange(intrange * data, int i); @@ -640,35 +640,16 @@ wordlistAdd(curlist, t); } -/* each proxy auth acl can be for a specific front-side protocol. */ static void -aclParseProxyAuthList(void *curlist) +aclParseProxyAuthList(void * curlist) { -/* This code currently non-functional */ -/* - acl_proxy_auth_data *pad; - char *t = NULL; - - pad = memAllocate(MEM_ACL_PROXY_AUTH_DATA); - pad->names = NULL; - *(acl_proxy_auth_data **)curlist = pad; - t = strtokFile(); + char *t=NULL; + splayNode **Top = curlist; - if (!strcmp(t, "basic")) - pad->type = AUTH_BASIC; -#if USE_NTLM - else if (!strcmp(t, "ntlm")) - pad->type = AUTH_NTLM; -#endif - else { - debug(28, 0) ("%s line %d: %s\n", - cfg_filename, config_lineno, config_input_line); - debug(28, 0) ("aclParseProxyAuthList: Invalid auth type '%s'\n", t); - return; - } - while ((t = strtokFile())) - wordlistAdd(&pad->names, t); -*/ + debug(28,1) ("parsing proxy-auth list\n"); + while ((t = strtokFile())) { + *Top=splay_insert(xstrdup(t), *Top, (SPLAYCMP *)strcmp); + } } /**********************/ @@ -678,12 +659,12 @@ static void aclParseDomainList(void *curlist) { - char *t = NULL; - splayNode **Top = curlist; - while ((t = strtokFile())) { - Tolower(t); - *Top = splay_insert(xstrdup(t), *Top, aclDomainCompare); - } + char *t = NULL; + splayNode **Top = curlist; + while ((t = strtokFile())) { + Tolower(t); + *Top = splay_insert(xstrdup(t), *Top, aclDomainCompare); + } } void @@ -782,7 +763,7 @@ aclParseMethodList(&A->data); break; case ACL_PROXY_AUTH: -#if 0 +#if 1 aclParseProxyAuthList(&A->data); #else aclParseWordList(&A->data); @@ -1050,6 +1031,18 @@ return 0; } +#if 1 +static int +aclMatchUser(void * dataptr, const char *user) +{ + splayNode *Top=dataptr; + + if (user==NULL) + return 0; + Top=splay_splay(user,Top,(SPLAYCMP *)strcmp); + return !splayLastResult; +} +#else static int aclMatchUser(wordlist * data, const char *user) { @@ -1076,6 +1069,7 @@ } return 0; } +#endif /* 0: basic and ok @@ -2216,6 +2210,7 @@ case ACL_SRC_ARP: case ACL_DST_DOMAIN: case ACL_SRC_DOMAIN: + case ACL_PROXY_AUTH: splay_destroy(a->data, xfree); break; #if SQUID_SNMP @@ -2224,9 +2219,11 @@ #if USE_IDENT case ACL_IDENT: #endif +#if 0 case ACL_PROXY_AUTH: wordlistDestroy((wordlist **) & a->data); break; +#endif case ACL_TIME: aclDestroyTimeList(a->data); break; diff -ur squid/src/structs.h squid-splay_acls/src/structs.h --- squid/src/structs.h Tue Oct 10 10:18:30 2000 +++ squid-splay_acls/src/structs.h Thu Oct 12 17:13:09 2000 @@ -31,6 +31,8 @@ * */ +#include "splay.h" + struct _dlink_node { void *data; dlink_node *prev; @@ -56,9 +58,10 @@ acl_time_data *next; }; +#define PROXY_AUTH_IS_CASE_INSENSITIVE 0x1 struct _acl_proxy_auth_data { - auth_type_t type; - wordlist *names; + uint32 flags; + splayNode *names; }; struct _acl_name_list {