s4:ldap_server: avoid pointless check arround LDAP_INVALID_CREDENTIALS
authorStefan Metzmacher <metze@samba.org>
Fri, 12 May 2017 14:04:02 +0000 (16:04 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 15 Jun 2017 07:13:23 +0000 (09:13 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/ldap_server/ldap_bind.c

index e36cb1cebf69b66367776581d0cfd2a49fe67a66..06b52fe9510c2c797e501c5699571408155b414c 100644 (file)
@@ -428,11 +428,9 @@ static NTSTATUS ldapsrv_BindSASL(struct ldapsrv_call *call)
 
        if (!NT_STATUS_IS_OK(status)) {
                status = nt_status_squash(status);
-               if (result == 0) {
-                       result = LDAP_INVALID_CREDENTIALS;
-                       errstr = ldapsrv_bind_error_msg(reply, HRES_SEC_E_LOGON_DENIED,
-                                                       0x0C0904DC, status);
-               }
+               result = LDAP_INVALID_CREDENTIALS;
+               errstr = ldapsrv_bind_error_msg(reply, HRES_SEC_E_LOGON_DENIED,
+                                               0x0C0904DC, status);
                talloc_unlink(conn, conn->gensec);
                conn->gensec = NULL;
                goto do_reply;