From 71c3be093db577aa52f6b9a9a3a9f442ca0d8f20 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 18 Oct 2011 20:18:41 +0000 Subject: [PATCH] pull up r25037 from trunk ------------------------------------------------------------------------ r25037 | ghudson | 2011-07-22 12:56:36 -0400 (Fri, 22 Jul 2011) | 9 lines 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. ticket: 6932 version_fixed: 1.9.2 status: resolved git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-9@25373 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/mechglue/g_set_cred_option.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib/gssapi/mechglue/g_set_cred_option.c b/src/lib/gssapi/mechglue/g_set_cred_option.c index 7bb73ed0b..953edaf1e 100644 --- a/src/lib/gssapi/mechglue/g_set_cred_option.c +++ b/src/lib/gssapi/mechglue/g_set_cred_option.c @@ -88,12 +88,14 @@ alloc_union_cred(OM_uint32 *minor_status, 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; -- 2.26.2