From d688f56f367bd3d7099eecf9414ddbb2bd82a646 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Fri, 5 Nov 2004 23:41:38 +0000 Subject: [PATCH] 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 --- modules/aaa/mod_authnz_ldap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 */ -- 2.40.0