diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-09-08 04:36:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:17:55 -0500 |
commit | 2f6d723e1f0858469794ee92cbe9e4445a7276cf (patch) | |
tree | 820f8002ba932ba29edacb60b80b758604feab7a /source4 | |
parent | 932265660e95cb2b4f0134bfec79e119fb89df8a (diff) | |
download | samba-2f6d723e1f0858469794ee92cbe9e4445a7276cf.tar.gz samba-2f6d723e1f0858469794ee92cbe9e4445a7276cf.tar.bz2 samba-2f6d723e1f0858469794ee92cbe9e4445a7276cf.zip |
r18249: Keep trying to start an GENSEC mech from the list until one actually
starts.
Andrew Bartlett
(This used to be commit 7dba525f5598199e89badbf15e0f5f09023c6cfa)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/auth/gensec/gensec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c index 84d198cb7b..c4b1e2494a 100644 --- a/source4/auth/gensec/gensec.c +++ b/source4/auth/gensec/gensec.c @@ -727,11 +727,12 @@ NTSTATUS gensec_start_mech_by_sasl_name(struct gensec_security *gensec_security, */ _PUBLIC_ NTSTATUS gensec_start_mech_by_sasl_list(struct gensec_security *gensec_security, - const char **sasl_names) + const char **sasl_names) { NTSTATUS nt_status; TALLOC_CTX *mem_ctx = talloc_new(gensec_security); const struct gensec_security_ops **ops; + int i; if (!mem_ctx) { return NT_STATUS_NO_MEMORY; } @@ -743,7 +744,12 @@ _PUBLIC_ NTSTATUS gensec_start_mech_by_sasl_list(struct gensec_security *gensec_ talloc_free(mem_ctx); return NT_STATUS_INVALID_PARAMETER; } - nt_status = gensec_start_mech_by_ops(gensec_security, ops[0]); + for (i=0; ops[i]; i++) { + nt_status = gensec_start_mech_by_ops(gensec_security, ops[i]); + if (!NT_STATUS_EQUAL(nt_status, NT_STATUS_INVALID_PARAMETER)) { + break; + } + } talloc_free(mem_ctx); return nt_status; } |