diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-12 12:26:12 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-06-15 09:13:24 +0200 |
commit | a2803671774fc4c02dfb42ea2527dc89964b4731 (patch) | |
tree | 2c5b19a1d17c874c3732767f5f9c68d142d8be49 /source4/ldap_server | |
parent | 461abf3ce337b147db7c3c9bffb972bae678f7df (diff) | |
download | samba-a2803671774fc4c02dfb42ea2527dc89964b4731.tar.gz |
s4:ldap_server: make the gensec_create_tstream() error checking more clear
Check with 'git show -w'.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/ldap_server')
-rw-r--r-- | source4/ldap_server/ldap_bind.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/source4/ldap_server/ldap_bind.c b/source4/ldap_server/ldap_bind.c index 352e67da1a7..cd6b7e43f96 100644 --- a/source4/ldap_server/ldap_bind.c +++ b/source4/ldap_server/ldap_bind.c @@ -499,21 +499,20 @@ static NTSTATUS ldapsrv_BindSASL(struct ldapsrv_call *call) context->conn->gensec, context->conn->sockets.raw, &context->sasl); - if (NT_STATUS_IS_OK(status)) { - if (!talloc_reference(context->sasl, conn->gensec)) { - return NT_STATUS_NO_MEMORY; - } - } - } - - if (!NT_STATUS_IS_OK(status)) { - result = LDAP_OPERATIONS_ERROR; - errstr = talloc_asprintf(reply, + if (!NT_STATUS_IS_OK(status)) { + result = LDAP_OPERATIONS_ERROR; + errstr = talloc_asprintf(reply, "SASL:[%s]: Failed to setup SASL socket: %s", req->creds.SASL.mechanism, nt_errstr(status)); - goto do_reply; - } else { + goto do_reply; + } + if (!talloc_reference(context->sasl, conn->gensec)) { + return NT_STATUS_NO_MEMORY; + } + } + + { status = gensec_session_info(conn->gensec, call, &session_info); if (!NT_STATUS_IS_OK(status)) { result = LDAP_OPERATIONS_ERROR; |