From: Bradley Nicholes Date: Fri, 5 Nov 2004 23:41:38 +0000 (+0000) Subject: Return the correct error when the user object is not found X-Git-Tag: 2.1.1~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d688f56f367bd3d7099eecf9414ddbb2bd82a646;p=apache Return the correct error when the user object is not found git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105697 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_authnz_ldap.c b/modules/aaa/mod_authnz_ldap.c index 9c2bbdf271..336603ac00 100644 --- a/modules/aaa/mod_authnz_ldap.c +++ b/modules/aaa/mod_authnz_ldap.c @@ -402,12 +402,10 @@ start_over: "[%d] auth_ldap authenticate: " "user %s authentication failed; URI %s [%s][%s]", getpid(), user, r->uri, ldc->reason, ldap_err2string(result)); - if (LDAP_INVALID_CREDENTIALS == result) { - return AUTH_DENIED; - } - else { - return AUTH_GENERAL_ERROR; - } + + return (LDAP_NO_SUCH_OBJECT == result) ? AUTH_USER_NOT_FOUND: \ + (LDAP_SECURITY_ERROR(result)) ? AUTH_DENIED: \ + AUTH_GENERAL_ERROR; } /* mark the user and DN */