mirror of
https://github.com/samba-team/samba.git
synced 2025-08-05 12:22:11 +03:00
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>
This commit is contained in:
committed by
Andrew Bartlett
parent
461abf3ce3
commit
a280367177
@ -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,
|
||||
"SASL:[%s]: Failed to setup SASL socket: %s",
|
||||
req->creds.SASL.mechanism, nt_errstr(status));
|
||||
goto do_reply;
|
||||
}
|
||||
|
||||
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,
|
||||
"SASL:[%s]: Failed to setup SASL socket: %s",
|
||||
req->creds.SASL.mechanism, nt_errstr(status));
|
||||
goto do_reply;
|
||||
} else {
|
||||
|
||||
{
|
||||
status = gensec_session_info(conn->gensec, call, &session_info);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
result = LDAP_OPERATIONS_ERROR;
|
||||
|
Reference in New Issue
Block a user