svn rev #25037: trunk/src/lib/gssapi/mechglue/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Jul 22 12:56:37 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25037
Commit By: ghudson
Log Message:
Fix gss_set_cred_option cred creation with no name.

When creating a cred in the mechglue with gss_acquire_cred, the
mechanism is allowed to return no name from gss_inquire_cred.  But in
the analagous operation in gss_set_cred_option, that would result in
an error from gss_display_name.  Make the call to gss_display_name
conditional on the mechanism name being set.  Reported by Andrew
Bartlett.


Changed Files:
U   trunk/src/lib/gssapi/mechglue/g_set_cred_option.c
Modified: trunk/src/lib/gssapi/mechglue/g_set_cred_option.c
===================================================================
--- trunk/src/lib/gssapi/mechglue/g_set_cred_option.c	2011-07-22 16:37:00 UTC (rev 25036)
+++ trunk/src/lib/gssapi/mechglue/g_set_cred_option.c	2011-07-22 16:56:36 UTC (rev 25037)
@@ -85,12 +85,14 @@
     if (status != GSS_S_COMPLETE)
 	goto cleanup;
 
-    status = mech->gss_display_name(minor_status,
-				    mech_name,
-				    &cred->auxinfo.name,
-				    &cred->auxinfo.name_type);
-    if (status != GSS_S_COMPLETE)
-	goto cleanup;
+    if (mech_name != GSS_C_NO_NAME) {
+	status = mech->gss_display_name(minor_status,
+					mech_name,
+					&cred->auxinfo.name,
+					&cred->auxinfo.name_type);
+	if (status != GSS_S_COMPLETE)
+	    goto cleanup;
+    }
 
     status = GSS_S_COMPLETE;
     *pcred = cred;




More information about the cvs-krb5 mailing list