diff --git a/inc/HTTPAuthSession.php b/inc/HTTPAuthSession.php index 1226bb93..64b406e5 100644 --- a/inc/HTTPAuthSession.php +++ b/inc/HTTPAuthSession.php @@ -451,7 +451,7 @@ class HTTPAuthSession { if (! $c->auth_cache) return 0; if (! isset($c->auth_cache_secret) || $c->auth_cache_secret == '') { - dbg_error_log('LOG', "HTTPAuthSession:CheckCache: caching of credentials is enabled, but \$c->auth_cache_secret isn't set, using auth source"); + dbg_error_log('LOG', "HTTPAuth:CheckCache: caching of credentials is enabled, but \$c->auth_cache_secret isn't set, using auth source"); return 0; } @@ -463,14 +463,14 @@ class HTTPAuthSession { $salt = $cache->get($cache_ns, 'salt'); if (!isset($salt) || (is_bool($salt) && $salt == false) || $salt == '') { - dbg_error_log('HTTPAuthLogin', 'CheckCache: No stored salt for %s, need to use auth source', $username); + dbg_error_log('HTTPAuth', 'CheckCache: No stored salt for %s, need to use auth source', $username); return 0; } # The hashed password to fetch $hash = $this->_MakeHash($password, $salt); if (! isset($hash)) { - dbg_error_log('LOG', 'HTTPAuthSession:CheckCache: failed to generate hash of credential, using auth source'); + dbg_error_log('LOG', 'HTTPAuth:CheckCache: failed to generate hash of credential, using auth source'); return 0; } @@ -478,15 +478,15 @@ class HTTPAuthSession { if (isset($cached_credentials)) { if ($cached_credentials === 'pass') { - dbg_error_log('HTTPAuthLogin', 'CheckCache: Cached credentials for %s are good and valid', $username); + dbg_error_log('HTTPAuth', 'CheckCache: Cached credentials for %s are good and valid', $username); return 1; } else if ($cached_credentials === 'fail') { - dbg_error_log('HTTPAuthLogin', 'CheckCache: Cached credentials for %s are good and invalid', $username); + dbg_error_log('HTTPAuth', 'CheckCache: Cached credentials for %s are good and invalid', $username); return 2; } - dbg_error_log('HTTPAuthLogin', 'CheckCache: No stored salted password for %s, need to use auth source', $username); + dbg_error_log('HTTPAuth', 'CheckCache: No stored salted password for %s, need to use auth source', $username); } # All hope is lost, we must have failed to find anything decent. @@ -502,7 +502,7 @@ class HTTPAuthSession { if (! $c->auth_cache) return 0; if (! isset($c->auth_cache_secret) || $c->auth_cache_secret === '') { - dbg_error_log('LOG', "HTTPAuthSession:CheckCache: caching of credentials is enabled, \$c->auth_cache_secret isn't set, not caching credential"); + dbg_error_log('LOG', "HTTPAuth:CheckCache: caching of credentials is enabled, \$c->auth_cache_secret isn't set, not caching credential"); return 0; } @@ -513,14 +513,14 @@ class HTTPAuthSession { } else if ($state === 'fail') { $expiry = $c->auth_cache_fail; } else { - dbg_error_log('ERROR', 'HTTPCheckCache: SetCache: Unexpected state %s, bailing out from caching credential.', $state); + dbg_error_log('ERROR', 'HTTPAuth:CheckCache: SetCache: Unexpected state %s, bailing out from caching credential.', $state); return 0; } # Only cache if the expiry is set to non-zero. This allows disabling # caching on a pass or fail basis. if ($expiry == 0) { - dbg_error_log('ERROR', 'HTTPCheckCache: SetCache: Expiry set to 0, not caching credential.', $state); + dbg_error_log('ERROR', 'HTTPAuth:CheckCache: SetCache: Expiry set to 0, not caching credential.', $state); return 0; } @@ -540,7 +540,7 @@ class HTTPAuthSession { # case scenario is that we won't access the cached credentials and # need to fail back to the full authentication source. if (! $cache->set($cache_ns, 'salt', $salt) ) { - dbg_error_log('ERROR', 'HTTPCheckCache: SetCache: Failed to store salt, bailing out from caching credential.'); + dbg_error_log('ERROR', 'HTTPAuth:CheckCache: SetCache: Failed to store salt, bailing out from caching credential.'); return 0; } } @@ -548,12 +548,12 @@ class HTTPAuthSession { # The hashed password to store $hash = $this->_MakeHash($password, $salt); if (! isset($hash)) { - dbg_error_log('ERROR', 'HTTPCheckCache: SetCache: Failed to generate hash, bailing out from caching credential.'); + dbg_error_log('ERROR', 'HTTPAuth:CheckCache: SetCache: Failed to generate hash, bailing out from caching credential.'); return 0; } if (! $cache->set($cache_ns, $hash, $state, $expiry) ) { - dbg_error_log('ERROR', 'HTTPCheckCache: SetCache: Failed to store credential.'); + dbg_error_log('ERROR', 'HTTPAuth:CheckCache: SetCache: Failed to store credential.'); return 0; } diff --git a/testing/tests/ldap_memcache/0001-test-ldap.result b/testing/tests/ldap_memcache/0001-test-ldap.result index a3777de5..b6bfbf33 100644 --- a/testing/tests/ldap_memcache/0001-test-ldap.result +++ b/testing/tests/ldap_memcache/0001-test-ldap.result @@ -66,6 +66,5 @@ SQL Query 1 Result: user_no: >1001< username: >ldap1< -No stored salt for ldap1, need to use auth source No salt for ldap1 found, passed No cached credentials found, passed diff --git a/testing/tests/ldap_memcache/0001-test-ldap.test b/testing/tests/ldap_memcache/0001-test-ldap.test index 29acf5e7..3275a696 100644 --- a/testing/tests/ldap_memcache/0001-test-ldap.test +++ b/testing/tests/ldap_memcache/0001-test-ldap.test @@ -74,9 +74,8 @@ my $cached_creds = 0; if (defined $request_id) { while (<$log>) { - if (/davical: $request_id: ALL: HTTPAuthLogin:CheckCache: (.*)/) { + if (/davical: $request_id: ALL: HTTPAuth:CheckCache: (.*)/) { my $msg = $1; -print "$msg\n"; if ($msg =~ /^No stored salt for ldap1,/) { $no_salt = 1; } elsif ($msg =~ /^Cached credentials for ldap1 are good/) { diff --git a/testing/tests/ldap_memcache/0003-test-ldap.test b/testing/tests/ldap_memcache/0003-test-ldap.test index 411fbf48..6c10fbf5 100644 --- a/testing/tests/ldap_memcache/0003-test-ldap.test +++ b/testing/tests/ldap_memcache/0003-test-ldap.test @@ -76,7 +76,7 @@ my $cached_creds = 0; if (defined $request_id) { while (<$log>) { - if (/davical: $request_id: ALL: HTTPAuthLogin:CheckCache: (.*)/) { + if (/davical: $request_id: ALL: HTTPAuth:CheckCache: (.*)/) { my $msg = $1; if ($msg =~ /^No salt, assuming no cached credentials/) { $no_salt = 1; diff --git a/testing/tests/ldap_memcache/0005-test-invalid-user.test b/testing/tests/ldap_memcache/0005-test-invalid-user.test index 1a07d3ae..c25cff1d 100644 --- a/testing/tests/ldap_memcache/0005-test-invalid-user.test +++ b/testing/tests/ldap_memcache/0005-test-invalid-user.test @@ -73,7 +73,7 @@ my $cached_creds = 0; if (defined $request_id) { while (<$log>) { - if (/davical: $request_id: ALL: HTTPAuthLogin:CheckCache: (.*)/) { + if (/davical: $request_id: ALL: HTTPAuth:CheckCache: (.*)/) { my $msg = $1; if ($msg =~ /^Cached credentials for ldap2/) { diff --git a/testing/tests/ldap_memcache/0007-test-invalid-user.test b/testing/tests/ldap_memcache/0007-test-invalid-user.test index 32cff077..5d5857b6 100644 --- a/testing/tests/ldap_memcache/0007-test-invalid-user.test +++ b/testing/tests/ldap_memcache/0007-test-invalid-user.test @@ -79,7 +79,7 @@ my $ldap_conn = 0; if (defined $request_id) { while (<$log>) { - if (/davical: $request_id: ALL: (HTTPAuthLogin:CheckCache|LDAP:drivers_ldap ): (.*)/) { + if (/davical: $request_id: ALL: (HTTPAuth:CheckCache|LDAP:drivers_ldap ): (.*)/) { my $msg = $2; if ($msg =~ /^No stored salt for ldap2,/) { $no_salt = 1;