]> granicus.if.org Git - apache/commitdiff
Return the correct error when the user object is not found
authorBradley Nicholes <bnicholes@apache.org>
Fri, 5 Nov 2004 23:41:38 +0000 (23:41 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Fri, 5 Nov 2004 23:41:38 +0000 (23:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105697 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_authnz_ldap.c

index 9c2bbdf271b284ce56715669584fd58ff319030c..336603ac00b3fda2fbad8dbde79d963a4d6bbed6 100644 (file)
@@ -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 */