debugs(28, 3, HERE << "checking password via authenticator");
/* make sure someone created auth_user_request for us */
+ assert(checklist->auth_user_request != NULL);
assert(checklist->auth_user_request->valid());
checklist->auth_user_request->start(LookupDone, checklist);
}
if (result != NULL)
fatal("AclLookupProxyAuthDone: Old code floating around somewhere.\nMake clean and if that doesn't work, report a bug to the squid developers.\n");
- if (!checklist->auth_user_request->valid() || checklist->conn() == NULL) {
+ if (checklist->auth_user_request == NULL || !checklist->auth_user_request->valid() || checklist->conn() == NULL) {
/* credentials could not be checked either way
* restart the whole process */
/* OR the connection was closed, there's no way to continue */
}
bool
-AuthUserRequest::valid()
+AuthUserRequest::valid() const
{
debugs(29, 9, HERE << "Validating AuthUserRequest '" << this << "'.");
- if (getRaw() == NULL) {
- debugs(29, 4, HERE << "AuthUserRequest was NULL!");
- return 0;
- }
-
if (user() == NULL) {
debugs(29, 4, HERE << "No associated AuthUser data");
- return 0;
+ return false;
}
if (user()->auth_type == AUTH_UNKNOWN) {
int
authenticateUserAuthenticated(AuthUserRequest::Pointer auth_user_request)
{
- if (!auth_user_request->valid())
+ if (auth_user_request == NULL || !auth_user_request->valid())
return 0;
return auth_user_request->authenticated();
debugs(29, 4, "authenticateAuthenticate: no connection authentication type");
*auth_user_request = AuthConfig::CreateAuthUser(proxy_auth);
- if (!(*auth_user_request)->valid()) {
- if (*auth_user_request == NULL)
- return AUTH_ACL_CHALLENGE;
-
+ if (*auth_user_request == NULL)
+ return AUTH_ACL_CHALLENGE;
+ else if (!(*auth_user_request)->valid()) {
/* the decode might have left a username for logging, or a message to
* the user */