Don't stomp minor code in spnego_gss_acquire_cred
authorGreg Hudson <ghudson@mit.edu>
Sun, 13 May 2012 17:12:06 +0000 (13:12 -0400)
committerGreg Hudson <ghudson@mit.edu>
Sun, 13 May 2012 17:12:06 +0000 (13:12 -0400)
When spnego_gss_acquire_cred passes through a failure status from the
mechglue, it overwrites the minor code with a call to
gss_release_oid_set().  Use a temporary minor status for that and a
related call.

src/lib/gssapi/spnego/spnego_mech.c

index 70246b6acb866a36c8a3debf7390ef5a39a98611..0c4e7279d464406c843d0208d1f1b08fc48f4b46 100644 (file)
@@ -331,7 +331,7 @@ spnego_gss_acquire_cred(OM_uint32 *minor_status,
                        gss_OID_set *actual_mechs,
                        OM_uint32 *time_rec)
 {
-       OM_uint32 status;
+       OM_uint32 status, tmpmin;
        gss_OID_set amechs;
        gss_cred_id_t mcred = NULL;
        spnego_gss_cred_id_t spcred = NULL;
@@ -375,9 +375,9 @@ spnego_gss_acquire_cred(OM_uint32 *minor_status,
        }
 
        if (actual_mechs && amechs != GSS_C_NULL_OID_SET) {
-               (void) gssint_copy_oid_set(minor_status, amechs, actual_mechs);
+               (void) gssint_copy_oid_set(&tmpmin, amechs, actual_mechs);
        }
-       (void) gss_release_oid_set(minor_status, &amechs);
+       (void) gss_release_oid_set(&tmpmin, &amechs);
 
        if (status == GSS_S_COMPLETE) {
                spcred->mcred = mcred;