pull up r23698 from trunk
authorTom Yu <tlyu@mit.edu>
Mon, 8 Feb 2010 20:55:46 +0000 (20:55 +0000)
committerTom Yu <tlyu@mit.edu>
Mon, 8 Feb 2010 20:55:46 +0000 (20:55 +0000)
 ------------------------------------------------------------------------
 r23698 | tlyu | 2010-02-05 15:52:42 -0500 (Fri, 05 Feb 2010) | 8 lines

 ticket: 6601
 tags: pullup
 target_version: 1.8

 Apply patch from Arlene Berry to handle the case where a mechanism
 implements set_cred_option but does not implement the requested
 option.

ticket: 6601
version_fixed: 1.8
status: resolved

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-8@23709 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/mechglue/g_set_cred_option.c

index fc8ed4c76496faa0d8c94f61368e2da9b25f93e0..ff388d9e3523ec9dc3e47f600f962679789ba248 100644 (file)
@@ -45,6 +45,8 @@ gssspi_set_cred_option(OM_uint32 *minor_status,
     gss_mechanism      mech;
     int                        i;
     OM_uint32          status;
+    OM_uint32          mech_status;
+    OM_uint32          mech_minor_status;
 
     if (minor_status == NULL)
        return GSS_S_CALL_INACCESSIBLE_WRITE;
@@ -66,14 +68,20 @@ gssspi_set_cred_option(OM_uint32 *minor_status,
        }
 
        if (mech->gssspi_set_cred_option == NULL) {
-           status = GSS_S_UNAVAILABLE;
            continue;
        }
 
-       status = (mech->gssspi_set_cred_option)(minor_status,
+       mech_status = (mech->gssspi_set_cred_option)(&mech_minor_status,
                                                union_cred->cred_array[i],
                                                desired_object,
                                                value);
+        if (mech_status == GSS_S_UNAVAILABLE) {
+            continue;
+        }
+        else {
+            status = mech_status;
+            *minor_status = mech_minor_status;
+        }
        if (status != GSS_S_COMPLETE) {
            map_error(minor_status, mech);
            break;