From: Amos Jeffries Date: Sun, 27 Mar 2011 05:59:28 +0000 (-0600) Subject: Cleanup: rename auth Config::authenticate to Config::authenticateProgram X-Git-Tag: take06~27^2~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58ee20934aee8edc501488fb84570e77fb598e80;p=thirdparty%2Fsquid.git Cleanup: rename auth Config::authenticate to Config::authenticateProgram Making it a bit clearer what this member actually is. --- diff --git a/src/auth/Config.h b/src/auth/Config.h index aa948e25bc..8c80fa9512 100644 --- a/src/auth/Config.h +++ b/src/auth/Config.h @@ -64,7 +64,7 @@ public: static AuthUserRequest::Pointer CreateAuthUser(const char *proxy_auth); static AuthConfig *Find(const char *proxy_auth); - AuthConfig() : authenticateChildren(20), authenticate(NULL) {} + AuthConfig() : authenticateChildren(20), authenticateProgram(NULL) {} virtual ~AuthConfig() {} @@ -132,7 +132,7 @@ public: public: HelperChildConfig authenticateChildren; - wordlist *authenticate; + wordlist *authenticateProgram; ///< Helper program to run, includes all parameters }; namespace Auth diff --git a/src/auth/UserRequest.cc b/src/auth/UserRequest.cc index 608574a015..0e19f908b5 100644 --- a/src/auth/UserRequest.cc +++ b/src/auth/UserRequest.cc @@ -215,8 +215,6 @@ AuthUserRequest::direction() return 0; return module_direction(); - - return -2; } void diff --git a/src/auth/basic/auth_basic.cc b/src/auth/basic/auth_basic.cc index eff1df7dad..c854f98281 100644 --- a/src/auth/basic/auth_basic.cc +++ b/src/auth/basic/auth_basic.cc @@ -78,7 +78,7 @@ AuthBasicConfig::active() const bool AuthBasicConfig::configured() const { - if ((authenticate != NULL) && (authenticateChildren.n_max != 0) && + if ((authenticateProgram != NULL) && (authenticateChildren.n_max != 0) && (basicAuthRealm != NULL)) { debugs(29, 9, HERE << "returning configured"); return true; @@ -120,7 +120,7 @@ BasicUser::authenticated() const void AuthBasicConfig::fixHeader(AuthUserRequest::Pointer auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request) { - if (authenticate) { + if (authenticateProgram) { debugs(29, 9, HERE << "Sending type:" << hdrType << " header: 'Basic realm=\"" << basicAuthRealm << "\"'"); httpHeaderPutStrf(&rep->header, hdrType, "Basic realm=\"%s\"", basicAuthRealm); } @@ -150,8 +150,8 @@ AuthBasicConfig::done() delete basicauthenticators; basicauthenticators = NULL; - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); if (basicAuthRealm) safe_free(basicAuthRealm); @@ -221,7 +221,7 @@ authenticateBasicHandleReply(void *data, char *reply) void AuthBasicConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme) { - wordlist *list = authenticate; + wordlist *list = authenticateProgram; storeAppendPrintf(entry, "%s %s", name, "basic"); while (list != NULL) { @@ -254,12 +254,12 @@ void AuthBasicConfig::parse(AuthConfig * scheme, int n_configured, char *param_str) { if (strcasecmp(param_str, "program") == 0) { - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); - parse_wordlist(&authenticate); + parse_wordlist(&authenticateProgram); - requirePathnameExists("auth_param basic program", authenticate->key); + requirePathnameExists("auth_param basic program", authenticateProgram->key); } else if (strcasecmp(param_str, "children") == 0) { authenticateChildren.parseConfig(); } else if (strcasecmp(param_str, "realm") == 0) { @@ -468,13 +468,13 @@ AuthBasicConfig::decode(char const *proxy_auth) void AuthBasicConfig::init(AuthConfig * schemeCfg) { - if (authenticate) { + if (authenticateProgram) { authbasic_initialised = 1; if (basicauthenticators == NULL) basicauthenticators = new helper("basicauthenticator"); - basicauthenticators->cmdline = authenticate; + basicauthenticators->cmdline = authenticateProgram; basicauthenticators->childs = authenticateChildren; diff --git a/src/auth/basic/basicUserRequest.cc b/src/auth/basic/basicUserRequest.cc index f3f45f7373..aebe0f0ddb 100644 --- a/src/auth/basic/basicUserRequest.cc +++ b/src/auth/basic/basicUserRequest.cc @@ -77,7 +77,7 @@ AuthBasicUserRequest::module_start(RH * handler, void *data) assert(basic_auth != NULL); debugs(29, 9, HERE << "'" << basic_auth->username() << ":" << basic_auth->passwd << "'"); - if (static_cast(AuthConfig::Find("basic"))->authenticate == NULL) { + if (static_cast(AuthConfig::Find("basic"))->authenticateProgram == NULL) { debugs(29, DBG_CRITICAL, "ERROR: No Basic authentication program configured."); handler(data, NULL); return; diff --git a/src/auth/digest/auth_digest.cc b/src/auth/digest/auth_digest.cc index e095fe686f..bdcef1cc97 100644 --- a/src/auth/digest/auth_digest.cc +++ b/src/auth/digest/auth_digest.cc @@ -545,7 +545,7 @@ digestScheme::done() void AuthDigestConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme) { - wordlist *list = authenticate; + wordlist *list = authenticateProgram; debugs(29, 9, "authDigestCfgDump: Dumping configuration"); storeAppendPrintf(entry, "%s %s", name, "digest"); @@ -571,7 +571,7 @@ AuthDigestConfig::active() const bool AuthDigestConfig::configured() const { - if ((authenticate != NULL) && + if ((authenticateProgram != NULL) && (authenticateChildren.n_max != 0) && (digestAuthRealm != NULL) && (noncemaxduration > -1)) return true; @@ -583,7 +583,7 @@ AuthDigestConfig::configured() const void AuthDigestConfig::fixHeader(AuthUserRequest::Pointer auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request) { - if (!authenticate) + if (!authenticateProgram) return; int stale = 0; @@ -651,7 +651,7 @@ DigestUser::ttl() const void AuthDigestConfig::init(AuthConfig * scheme) { - if (authenticate) { + if (authenticateProgram) { DigestFieldsInfo = httpHeaderBuildFieldsInfo(DigestAttrs, DIGEST_ENUM_END); authenticateDigestNonceSetup(); authdigest_initialised = 1; @@ -659,7 +659,7 @@ AuthDigestConfig::init(AuthConfig * scheme) if (digestauthenticators == NULL) digestauthenticators = new helper("digestauthenticator"); - digestauthenticators->cmdline = authenticate; + digestauthenticators->cmdline = authenticateProgram; digestauthenticators->childs = authenticateChildren; @@ -683,8 +683,8 @@ AuthDigestConfig::registerWithCacheManager(void) void AuthDigestConfig::done() { - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); safe_free(digestAuthRealm); } @@ -708,12 +708,12 @@ void AuthDigestConfig::parse(AuthConfig * scheme, int n_configured, char *param_str) { if (strcasecmp(param_str, "program") == 0) { - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); - parse_wordlist(&authenticate); + parse_wordlist(&authenticateProgram); - requirePathnameExists("auth_param digest program", authenticate->key); + requirePathnameExists("auth_param digest program", authenticateProgram->key); } else if (strcasecmp(param_str, "children") == 0) { authenticateChildren.parseConfig(); } else if (strcasecmp(param_str, "realm") == 0) { diff --git a/src/auth/digest/digestUserRequest.cc b/src/auth/digest/digestUserRequest.cc index d7d9d8fa4e..2e2620dbd9 100644 --- a/src/auth/digest/digestUserRequest.cc +++ b/src/auth/digest/digestUserRequest.cc @@ -209,7 +209,7 @@ AuthDigestUserRequest::addHeader(HttpReply * rep, int accel) return; #endif - if ((static_cast(AuthConfig::Find("digest"))->authenticate) && authDigestNonceLastRequest(nonce)) { + if ((static_cast(AuthConfig::Find("digest"))->authenticateProgram) && authDigestNonceLastRequest(nonce)) { flags.authinfo_sent = 1; debugs(29, 9, "authDigestAddHead: Sending type:" << type << " header: 'nextnonce=\"" << authenticateDigestNonceNonceb64(nonce) << "\""); httpHeaderPutStrf(&rep->header, type, "nextnonce=\"%s\"", authenticateDigestNonceNonceb64(nonce)); @@ -254,7 +254,7 @@ AuthDigestUserRequest::module_start(RH * handler, void *data) assert(user() != NULL && user()->auth_type == AUTH_DIGEST); debugs(29, 9, "authenticateStart: '\"" << user()->username() << "\":\"" << realm << "\"'"); - if (static_cast(AuthConfig::Find("digest"))->authenticate == NULL) { + if (static_cast(AuthConfig::Find("digest"))->authenticateProgram == NULL) { debugs(29, DBG_CRITICAL, "ERROR: No Digest authentication program configured."); handler(data, NULL); return; diff --git a/src/auth/negotiate/auth_negotiate.cc b/src/auth/negotiate/auth_negotiate.cc index bd2efe90e3..7b1e3e96c5 100644 --- a/src/auth/negotiate/auth_negotiate.cc +++ b/src/auth/negotiate/auth_negotiate.cc @@ -104,8 +104,8 @@ AuthNegotiateConfig::done() delete negotiateauthenticators; negotiateauthenticators = NULL; - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); debugs(29, 2, "negotiateScheme::done: Negotiate authentication Shutdown."); } @@ -113,7 +113,7 @@ AuthNegotiateConfig::done() void AuthNegotiateConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme) { - wordlist *list = authenticate; + wordlist *list = authenticateProgram; storeAppendPrintf(entry, "%s %s", name, "negotiate"); while (list != NULL) { @@ -134,12 +134,12 @@ void AuthNegotiateConfig::parse(AuthConfig * scheme, int n_configured, char *param_str) { if (strcasecmp(param_str, "program") == 0) { - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); - parse_wordlist(&authenticate); + parse_wordlist(&authenticateProgram); - requirePathnameExists("auth_param negotiate program", authenticate->key); + requirePathnameExists("auth_param negotiate program", authenticateProgram->key); } else if (strcasecmp(param_str, "children") == 0) { authenticateChildren.parseConfig(); } else if (strcasecmp(param_str, "keep_alive") == 0) { @@ -162,7 +162,7 @@ AuthNegotiateConfig::type() const void AuthNegotiateConfig::init(AuthConfig * scheme) { - if (authenticate) { + if (authenticateProgram) { authnegotiate_initialised = 1; @@ -174,7 +174,7 @@ AuthNegotiateConfig::init(AuthConfig * scheme) assert(proxy_auth_cache); - negotiateauthenticators->cmdline = authenticate; + negotiateauthenticators->cmdline = authenticateProgram; negotiateauthenticators->childs = authenticateChildren; @@ -203,7 +203,7 @@ AuthNegotiateConfig::active() const bool AuthNegotiateConfig::configured() const { - if ((authenticate != NULL) && (authenticateChildren.n_max != 0)) { + if (authenticateProgram && (authenticateChildren.n_max != 0)) { debugs(29, 9, "AuthNegotiateConfig::configured: returning configured"); return true; } @@ -219,7 +219,7 @@ AuthNegotiateConfig::fixHeader(AuthUserRequest::Pointer auth_user_request, HttpR { AuthNegotiateUserRequest *negotiate_request; - if (!authenticate) + if (!authenticateProgram) return; /* Need keep-alive */ diff --git a/src/auth/negotiate/negotiateUserRequest.cc b/src/auth/negotiate/negotiateUserRequest.cc index 7127798d35..477e2fa20f 100644 --- a/src/auth/negotiate/negotiateUserRequest.cc +++ b/src/auth/negotiate/negotiateUserRequest.cc @@ -121,7 +121,7 @@ AuthNegotiateUserRequest::module_start(RH * handler, void *data) debugs(29, 8, HERE << "auth state is '" << user()->credentials() << "'"); - if (static_cast(AuthConfig::Find("negotiate"))->authenticate == NULL) { + if (static_cast(AuthConfig::Find("negotiate"))->authenticateProgram == NULL) { debugs(29, DBG_CRITICAL, "ERROR: No Negotiate authentication program configured."); handler(data, NULL); return; diff --git a/src/auth/ntlm/auth_ntlm.cc b/src/auth/ntlm/auth_ntlm.cc index 406045aab7..de52cb58e3 100644 --- a/src/auth/ntlm/auth_ntlm.cc +++ b/src/auth/ntlm/auth_ntlm.cc @@ -92,8 +92,8 @@ AuthNTLMConfig::done() delete ntlmauthenticators; ntlmauthenticators = NULL; - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); debugs(29, 2, "ntlmScheme::done: NTLM authentication Shutdown."); } @@ -101,7 +101,7 @@ AuthNTLMConfig::done() void AuthNTLMConfig::dump(StoreEntry * entry, const char *name, AuthConfig * scheme) { - wordlist *list = authenticate; + wordlist *list = authenticateProgram; storeAppendPrintf(entry, "%s %s", name, "ntlm"); while (list != NULL) { @@ -122,12 +122,12 @@ void AuthNTLMConfig::parse(AuthConfig * scheme, int n_configured, char *param_str) { if (strcasecmp(param_str, "program") == 0) { - if (authenticate) - wordlistDestroy(&authenticate); + if (authenticateProgram) + wordlistDestroy(&authenticateProgram); - parse_wordlist(&authenticate); + parse_wordlist(&authenticateProgram); - requirePathnameExists("auth_param ntlm program", authenticate->key); + requirePathnameExists("auth_param ntlm program", authenticateProgram->key); } else if (strcasecmp(param_str, "children") == 0) { authenticateChildren.parseConfig(); } else if (strcasecmp(param_str, "keep_alive") == 0) { @@ -148,7 +148,7 @@ AuthNTLMConfig::type() const void AuthNTLMConfig::init(AuthConfig * scheme) { - if (authenticate) { + if (authenticateProgram) { authntlm_initialised = 1; @@ -160,7 +160,7 @@ AuthNTLMConfig::init(AuthConfig * scheme) assert(proxy_auth_cache); - ntlmauthenticators->cmdline = authenticate; + ntlmauthenticators->cmdline = authenticateProgram; ntlmauthenticators->childs = authenticateChildren; @@ -189,7 +189,7 @@ AuthNTLMConfig::active() const bool AuthNTLMConfig::configured() const { - if ((authenticate != NULL) && (authenticateChildren.n_max != 0)) { + if ((authenticateProgram != NULL) && (authenticateChildren.n_max != 0)) { debugs(29, 9, "AuthNTLMConfig::configured: returning configured"); return true; } @@ -203,7 +203,7 @@ AuthNTLMConfig::configured() const void AuthNTLMConfig::fixHeader(AuthUserRequest::Pointer auth_user_request, HttpReply *rep, http_hdr_type hdrType, HttpRequest * request) { - if (!authenticate) + if (!authenticateProgram) return; /* Need keep-alive */ diff --git a/src/auth/ntlm/ntlmUserRequest.cc b/src/auth/ntlm/ntlmUserRequest.cc index 6182426c65..cce95b23ac 100644 --- a/src/auth/ntlm/ntlmUserRequest.cc +++ b/src/auth/ntlm/ntlmUserRequest.cc @@ -79,7 +79,7 @@ AuthNTLMUserRequest::module_start(RH * handler, void *data) debugs(29, 8, HERE << "credentials state is '" << user()->credentials() << "'"); - if (static_cast(AuthConfig::Find("ntlm"))->authenticate == NULL) { + if (static_cast(AuthConfig::Find("ntlm"))->authenticateProgram == NULL) { debugs(29, DBG_CRITICAL, "ERROR: NTLM Start: no NTLM program configured."); handler(data, NULL); return;