s4:ldap_server: set result = LDAP_SUCCESS at the end, when we're really done
authorStefan Metzmacher <metze@samba.org>
Fri, 12 May 2017 10:41:13 +0000 (12:41 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 15 Jun 2017 07:13:24 +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 71376429756dfc491534e3fc1bc483703104f7de..9336d167aa537168273d5621fe0b545b3c1147a9 100644 (file)
@@ -436,9 +436,6 @@ static NTSTATUS ldapsrv_BindSASL(struct ldapsrv_call *call)
                goto do_reply;
        }
 
-       result = LDAP_SUCCESS;
-       errstr = NULL;
-
        if (gensec_have_feature(conn->gensec, GENSEC_FEATURE_SIGN) ||
            gensec_have_feature(conn->gensec, GENSEC_FEATURE_SEAL)) {
 
@@ -553,6 +550,8 @@ static NTSTATUS ldapsrv_BindSASL(struct ldapsrv_call *call)
        conn->gensec = NULL;
 
        *resp->SASL.secblob = output;
+       result = LDAP_SUCCESS;
+       errstr = NULL;
 
 do_reply:
        if (result != LDAP_SASL_BIND_IN_PROGRESS) {