1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00

auth/spnego: introduce an early return in gensec_spnego_create_negTokenInit()

This avoids print two debug message for the same failure.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2017-07-13 16:20:59 +02:00 committed by Andreas Schneider
parent 6a3c50f368
commit d9e764ed9b

View File

@ -214,7 +214,7 @@ static NTSTATUS gensec_spnego_create_negTokenInit(struct gensec_security *gensec
DATA_BLOB *out) DATA_BLOB *out)
{ {
int i; int i;
NTSTATUS status = NT_STATUS_INVALID_PARAMETER; NTSTATUS status;
const char **mechTypes = NULL; const char **mechTypes = NULL;
DATA_BLOB unwrapped_out = data_blob_null; DATA_BLOB unwrapped_out = data_blob_null;
const struct gensec_security_ops_wrapper *all_sec; const struct gensec_security_ops_wrapper *all_sec;
@ -302,15 +302,21 @@ static NTSTATUS gensec_spnego_create_negTokenInit(struct gensec_security *gensec
spnego_state->sub_sec_security->ops->name, spnego_state->sub_sec_security->ops->name,
principal, next, nt_errstr(status))); principal, next, nt_errstr(status)));
if (next == NULL) {
/*
* A hard error without a possible fallback.
*/
return status;
}
/* /*
* Pretend we never started it * Pretend we never started it
*/ */
gensec_spnego_update_sub_abort(spnego_state); gensec_spnego_update_sub_abort(spnego_state);
} }
DBG_WARNING("Failed to setup SPNEGO negTokenInit request: %s\n", DBG_WARNING("Failed to setup SPNEGO negTokenInit request\n");
nt_errstr(status)); return NT_STATUS_INVALID_PARAMETER;
return status;
reply: reply:
spnego_out.type = SPNEGO_NEG_TOKEN_INIT; spnego_out.type = SPNEGO_NEG_TOKEN_INIT;