]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: rename auth Config::authenticate to Config::authenticateProgram
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 27 Mar 2011 05:59:28 +0000 (23:59 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 27 Mar 2011 05:59:28 +0000 (23:59 -0600)
Making it a bit clearer what this member actually is.

src/auth/Config.h
src/auth/UserRequest.cc
src/auth/basic/auth_basic.cc
src/auth/basic/basicUserRequest.cc
src/auth/digest/auth_digest.cc
src/auth/digest/digestUserRequest.cc
src/auth/negotiate/auth_negotiate.cc
src/auth/negotiate/negotiateUserRequest.cc
src/auth/ntlm/auth_ntlm.cc
src/auth/ntlm/ntlmUserRequest.cc

index aa948e25bc34c2c7a9410968b660c315d303d485..8c80fa9512158e068075f459e2c3c0b835f813db 100644 (file)
@@ -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
index 608574a015bcdd0573a1aadf359a8695de32ab61..0e19f908b5f1cbd931df4bddd3375f930e87702a 100644 (file)
@@ -215,8 +215,6 @@ AuthUserRequest::direction()
         return 0;
 
     return module_direction();
-
-    return -2;
 }
 
 void
index eff1df7dad67b82c56ef99d0c8c3400078b4a0ee..c854f9828113146ad9b9e5ac1e15df80e640c02b 100644 (file)
@@ -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;
 
index f3f45f7373f7649c9f04cd9866afe7c39c33eb93..aebe0f0ddbdf30b71a90f226be2d32701954dc04 100644 (file)
@@ -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<AuthBasicConfig*>(AuthConfig::Find("basic"))->authenticate == NULL) {
+    if (static_cast<AuthBasicConfig*>(AuthConfig::Find("basic"))->authenticateProgram == NULL) {
         debugs(29, DBG_CRITICAL, "ERROR: No Basic authentication program configured.");
         handler(data, NULL);
         return;
index e095fe686f58eb726469c966221ab0815dbc5982..bdcef1cc9775afbb9298af7a4974d3b6bd22debc 100644 (file)
@@ -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) {
index d7d9d8fa4e7757d27e74b8891e73d350725f700c..2e2620dbd9b02c780648b4d7c59e74739554a7cb 100644 (file)
@@ -209,7 +209,7 @@ AuthDigestUserRequest::addHeader(HttpReply * rep, int accel)
         return;
 #endif
 
-    if ((static_cast<AuthDigestConfig*>(AuthConfig::Find("digest"))->authenticate) && authDigestNonceLastRequest(nonce)) {
+    if ((static_cast<AuthDigestConfig*>(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<AuthDigestConfig*>(AuthConfig::Find("digest"))->authenticate == NULL) {
+    if (static_cast<AuthDigestConfig*>(AuthConfig::Find("digest"))->authenticateProgram == NULL) {
         debugs(29, DBG_CRITICAL, "ERROR: No Digest authentication program configured.");
         handler(data, NULL);
         return;
index bd2efe90e3efe3ac53c6107827097d042740253e..7b1e3e96c5b3e00b7f1bb3493f17800071a9dc0c 100644 (file)
@@ -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 */
index 7127798d35ee4e99a927a14d8c244d82b2af756b..477e2fa20f8f7ce32e25c2327eded3054ffa7235 100644 (file)
@@ -121,7 +121,7 @@ AuthNegotiateUserRequest::module_start(RH * handler, void *data)
 
     debugs(29, 8, HERE << "auth state is '" << user()->credentials() << "'");
 
-    if (static_cast<AuthNegotiateConfig*>(AuthConfig::Find("negotiate"))->authenticate == NULL) {
+    if (static_cast<AuthNegotiateConfig*>(AuthConfig::Find("negotiate"))->authenticateProgram == NULL) {
         debugs(29, DBG_CRITICAL, "ERROR: No Negotiate authentication program configured.");
         handler(data, NULL);
         return;
index 406045aab73eded7264b353577b9d4506522bb98..de52cb58e3c390679338e44f626d2018b65b0118 100644 (file)
@@ -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 */
index 6182426c65d683849aea4613ce45c25d9c62517e..cce95b23ac37c5a15cbdc6c94b72ca06d3da39fa 100644 (file)
@@ -79,7 +79,7 @@ AuthNTLMUserRequest::module_start(RH * handler, void *data)
 
     debugs(29, 8, HERE << "credentials state is '" << user()->credentials() << "'");
 
-    if (static_cast<AuthNTLMConfig*>(AuthConfig::Find("ntlm"))->authenticate == NULL) {
+    if (static_cast<AuthNTLMConfig*>(AuthConfig::Find("ntlm"))->authenticateProgram == NULL) {
         debugs(29, DBG_CRITICAL, "ERROR: NTLM Start: no NTLM program configured.");
         handler(data, NULL);
         return;