summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-07-13 16:49:57 +0200
committerAndreas Schneider <asn@cryptomilk.org>2017-07-25 13:51:10 +0200
commit9502f535338f06f334e294827ea339001d8625b8 (patch)
tree9f9097f6a596e14b27e1a72bb774a9df5a802752 /auth
parent3bf494645044f858e7e34501d7b39e2677745ede (diff)
downloadsamba-9502f535338f06f334e294827ea339001d8625b8.tar.gz
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>
Diffstat (limited to 'auth')
-rw-r--r--auth/gensec/spnego.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/auth/gensec/spnego.c b/auth/gensec/spnego.c
index f8ab11493f9..f16b39a2c70 100644
--- a/auth/gensec/spnego.c
+++ b/auth/gensec/spnego.c
@@ -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");