Skip to content

Commit f2b4591

Browse files
committed
Fix handling of context initialization
If a previous call has decided to use only local (to the process) credentials, then we need to override all the way to the end. A previous patch also swapped the order in which credential handler and context handler are initialized, make sure also to swap the fallback checks. Set the behavior to the process default only if it wasn't forced to local. Signed-off-by: Simo Sorce <[email protected]> Reviewed-by: Lukas Slebodnik <[email protected]>
1 parent 00c6b95 commit f2b4591

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

proxy/src/mechglue/gpp_init_sec_context.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ OM_uint32 gssi_init_sec_context(OM_uint32 *minor_status,
110110
/* ok this means a previous call decided to use the local mech,
111111
* so let's just re-enter the mechglue here and keep at it */
112112
behavior = GPP_LOCAL_ONLY;
113-
} else if (behavior == GPP_LOCAL_ONLY) {
114-
maj = GSS_S_DEFECTIVE_CREDENTIAL;
115-
min = 0;
116-
goto done;
117113
}
118114
} else {
119115
ctx_handle = calloc(1, sizeof(struct gpp_context_handle));
@@ -131,6 +127,10 @@ OM_uint32 gssi_init_sec_context(OM_uint32 *minor_status,
131127
* local mech, so let's just re-enter the mechglue here, as we
132128
* have no way to export creds yet. */
133129
behavior = GPP_LOCAL_ONLY;
130+
} else if (behavior == GPP_LOCAL_ONLY) {
131+
maj = GSS_S_DEFECTIVE_CREDENTIAL;
132+
min = 0;
133+
goto done;
134134
}
135135
} else {
136136
cred_handle = calloc(1, sizeof(struct gpp_cred_handle));
@@ -142,7 +142,9 @@ OM_uint32 gssi_init_sec_context(OM_uint32 *minor_status,
142142
}
143143

144144
name = (struct gpp_name_handle *)target_name;
145-
behavior = gpp_get_behavior();
145+
if (behavior == GPP_UNINITIALIZED) {
146+
behavior = gpp_get_behavior();
147+
}
146148

147149
/* See if we should try local first */
148150
if (behavior == GPP_LOCAL_ONLY || behavior == GPP_LOCAL_FIRST) {

0 commit comments

Comments
 (0)