Include the username in the log messages.

This commit is contained in:
Andrew Ruthven 2022-12-19 23:06:56 +13:00
parent ee26ee730f
commit 55feb03139
2 changed files with 5 additions and 5 deletions

View File

@ -464,20 +464,20 @@ class HTTPAuthSession {
if (isset($cached_credentials)) {
if ($cached_credentials == 'pass') {
dbg_error_log('HTTPAuthLogin', 'CheckCache: Cached credentials are good and valid');
dbg_error_log('HTTPAuthLogin', 'CheckCache: Cached credentials for %s are good and valid', $username);
return 1;
} else if ($cached_credentials == 'fail') {
dbg_error_log('HTTPAuthLogin', 'CheckCache: Cached credentials are good and invalid');
dbg_error_log('HTTPAuthLogin', 'CheckCache: Cached credentials for %s are good and invalid', $username);
return 2;
}
} else {
dbg_error_log('HTTPAuthLogin', 'CheckCache: No stored salted password, need to use auth source');
dbg_error_log('HTTPAuthLogin', 'CheckCache: No stored salted password for %s, need to use auth source', $username);
}
} else {
dbg_error_log('HTTPAuthLogin', 'CheckCache: No salt, assuming no cached credentials, need to use auth source');
dbg_error_log('HTTPAuthLogin', 'CheckCache: No salt stored for %s, assuming no cached credentials, need to use auth source', $username);
}
# All hope is lost, we must have failed to find anything decent.

View File

@ -1,5 +1,5 @@
# Just check to see if the log line for cached credentials being valid is
# present. That is only issued if we're successfully fetch valid credentials
# from our cache.
SCRIPT=if grep -q "HTTPAuthLogin:CheckCache: Cached credentials are good and valid" /var/log/apache2/regression-error.log; then echo "Cached credentials worked"; else echo "Ccahed credentials failed"; fi
SCRIPT=if grep -q "HTTPAuthLogin:CheckCache: Cached credentials for user1 are good and valid" /var/log/apache2/regression-error.log; then echo "Cached credentials worked"; else echo "Cached credentials failed"; fi