From: hno <> Date: Tue, 9 Jan 2001 02:36:26 +0000 (+0000) Subject: Various auth_rewrite/splay_userauth fixes by Robert Collins X-Git-Tag: SQUID_3_0_PRE1~1672 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=912b43b8f55e4a9cf8a954f18ac56cf2965c7404;p=thirdparty%2Fsquid.git Various auth_rewrite/splay_userauth fixes by Robert Collins * auth_modules is no longer a top-level subdir. Don't try to reference it from the makefile. * more name changes from proxyauth to user, missed by Henrik * corrected addition to a existing user list * fixed a coredump on shutdown with empty user lists (i.e. only REQUIRED) * fixed a reconfigure bug where the authentication shemes got somewhat trashed * added a debug log message when a new scheme is added --- diff --git a/src/acl.cc b/src/acl.cc index 9f7b317bc6..212ab5b0bb 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.236 2001/01/07 23:36:37 hno Exp $ + * $Id: acl.cc,v 1.237 2001/01/08 19:36:26 hno Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -641,12 +641,13 @@ aclParseUserList(void **current) acl_user_data *data; splayNode *Top = NULL; - debug(28, 2) ("aclParseUserList: parsing authlist\n"); + debug(28, 2) ("aclParseUserList: parsing user list\n"); if (*current == NULL) { debug(28, 3) ("aclParseUserList: current is null. Creating\n"); - *current = memAllocate(MEM_ACL_USER_DATA); /*we rely on mA. zeroing */ + *current = memAllocate(MEM_ACL_USER_DATA); } data = *current; + Top = data->names; if ((t = strtokFile())) { debug(28, 5) ("aclParseUserList: First token is %s\n", t); if (strcmp("-i", t) == 0) { @@ -665,7 +666,7 @@ aclParseUserList(void **current) data->flags.case_insensitive); /* we might inherit from a previous declaration */ - debug(28, 4) ("aclParseUserList: parsing proxy-auth list\n"); + debug(28, 4) ("aclParseUserList: parsing user list\n"); while ((t = strtokFile())) { debug(28, 6) ("aclParseUserList: Got token: %s\n", t); if (data->flags.case_insensitive) @@ -1977,7 +1978,8 @@ static void aclFreeUserData(void *data) { acl_user_data *d = data; - splay_destroy(d->names, xfree); + if (d->names) + splay_destroy(d->names, xfree); memFree(d, MEM_ACL_USER_DATA); } @@ -2802,4 +2804,4 @@ aclDumpArpList(void *data) } /* ==== END ARP ACL SUPPORT =============================================== */ -#endif /* USE_ARP_ACL */ +#endif /* USE_ARP_ACL */ diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index ff439ef3d2..ebd4aa3b15 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -1,6 +1,6 @@ /* - * $Id: auth_ntlm.cc,v 1.1 2001/01/07 23:36:48 hno Exp $ + * $Id: auth_ntlm.cc,v 1.2 2001/01/08 19:36:27 hno Exp $ * * DEBUG: section 29 NTLM Authenticator * AUTHOR: Robert Collins @@ -235,10 +235,11 @@ authNTLMInit(authScheme * scheme) int authenticateNTLMActive() { - if (authntlm_initialised) - return 1; - else - return 0; + if ((ntlmConfig != NULL) && (ntlmConfig->authenticate != NULL) && + (ntlmConfig->authenticateChildren != 0) && (ntlmConfig->challengeuses > -1) + && (ntlmConfig->challengelifetime>-1)) + return 1; + return 0; } /* NTLM Scheme */ diff --git a/src/authenticate.cc b/src/authenticate.cc index d03079626a..ed8d82bf59 100644 --- a/src/authenticate.cc +++ b/src/authenticate.cc @@ -1,6 +1,6 @@ /* - * $Id: authenticate.cc,v 1.15 2001/01/07 23:36:37 hno Exp $ + * $Id: authenticate.cc,v 1.16 2001/01/08 19:36:26 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -370,7 +370,8 @@ authenticateShutdown(void) authscheme_list[i].donefunc(); else debug(29, 2) ("authenticateShutdown: scheme %s has not registered a shutdown function.\n", authscheme_list[i].typestr); - authscheme_list[i].typestr = NULL; + if (!reconfiguring) + authscheme_list[i].typestr = NULL; } } @@ -634,6 +635,7 @@ void authSchemeAdd(char *type, AUTHSSETUP * setup) { int i; + debug(29, 4) ("authSchemeAdd: adding %s", type); /* find the number of currently known authscheme types */ for (i = 0; authscheme_list && authscheme_list[i].typestr; i++) { assert(strcmp(authscheme_list[i].typestr, type) != 0); diff --git a/src/typedefs.h b/src/typedefs.h index f28297ed7d..5d784b21f1 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.116 2001/01/07 23:36:41 hno Exp $ + * $Id: typedefs.h,v 1.117 2001/01/08 19:36:27 hno Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -61,7 +61,6 @@ typedef struct _acl_ip_data acl_ip_data; typedef struct _acl_time_data acl_time_data; typedef struct _acl_name_list acl_name_list; typedef struct _acl_deny_info_list acl_deny_info_list; -typedef struct _acl_proxy_auth acl_proxy_auth; typedef struct _auth_user_t auth_user_t; typedef struct _auth_user_request_t auth_user_request_t; typedef struct _auth_user_hash_pointer auth_user_hash_pointer; @@ -353,4 +352,4 @@ typedef RemovalPolicy *REMOVALPOLICYCREATE(wordlist * args); typedef int STDIRSELECT(const StoreEntry *); -#endif /* _TYPEDEFS_H_ */ +#endif /* _TYPEDEFS_H_ */