1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

auth/spnego: invert the fallback logic in gensec_spnego_client_negTokenInit()

We should do the return first, that will simplify further changes.

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:49:57 +02:00 committed by Andreas Schneider
parent 3bf4946450
commit 9502f53533

View File

@ -470,19 +470,18 @@ static NTSTATUS gensec_spnego_client_negTokenInit(struct gensec_security *gensec
spnego_state->sub_sec_security->ops->name,
principal, next, nt_errstr(status)));
if (allow_fallback && next != NULL) {
if (next == NULL) {
/*
* Pretend we never started it.
* A hard error without a possible fallback.
*/
gensec_spnego_update_sub_abort(spnego_state);
continue;
TALLOC_FREE(frame);
return status;
}
/*
* Hard error.
* Pretend we never started it.
*/
TALLOC_FREE(frame);
return status;
gensec_spnego_update_sub_abort(spnego_state);
}
DBG_WARNING("Could not find a suitable mechtype in NEG_TOKEN_INIT\n");