summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-10 08:13:40 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-10 20:49:24 +1100
commit93f3fc54e462958c3bc88ebf586be99fb703347b (patch)
tree58133461a037326ade7c421b75d10a36af1acb30 /auth
parent901e3b7246de9bdc07e2b3d88f55917bf2a37377 (diff)
downloadsamba-93f3fc54e462958c3bc88ebf586be99fb703347b.tar.gz
samba-93f3fc54e462958c3bc88ebf586be99fb703347b.tar.bz2
samba-93f3fc54e462958c3bc88ebf586be99fb703347b.zip
gensec: set flag to continue in outer for loop in gensec_use_kerberos_mechs
This should be the correct fix for the valgrind erorr Volker found in 744ed53a62037a659133ccd4de2065491208ae7d. This fix avoids putting SPNEGO into the list twice when we are in the CRED_DONT_USE_KERBEROS case. Andrew Bartlett
Diffstat (limited to 'auth')
-rw-r--r--auth/gensec/gensec_start.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/auth/gensec/gensec_start.c b/auth/gensec/gensec_start.c
index 08b2fb68cb..e9ccb16b0c 100644
--- a/auth/gensec/gensec_start.c
+++ b/auth/gensec/gensec_start.c
@@ -83,14 +83,18 @@ _PUBLIC_ struct gensec_security_ops **gensec_use_kerberos_mechs(TALLOC_CTX *mem_
j = 0;
for (i=0; old_gensec_list && old_gensec_list[i]; i++) {
int oid_idx;
-
+ bool found_spnego = false;
for (oid_idx = 0; old_gensec_list[i]->oid && old_gensec_list[i]->oid[oid_idx]; oid_idx++) {
if (strcmp(old_gensec_list[i]->oid[oid_idx], GENSEC_OID_SPNEGO) == 0) {
new_gensec_list[j] = old_gensec_list[i];
j++;
+ found_spnego = true;
break;
}
}
+ if (found_spnego) {
+ continue;
+ }
switch (use_kerberos) {
case CRED_DONT_USE_KERBEROS:
if (old_gensec_list[i]->kerberos == false) {