From ea4de1bb8ad087485b4eee6a1c03db826e1e9f03 Mon Sep 17 00:00:00 2001 From: Alexandra Ellwood Date: Fri, 17 Oct 2008 18:34:51 +0000 Subject: [PATCH] KLCreatePrincipalFromTriplet should work with empty instance Fixed bug where shim layer was calling kim_identity_create_from_components incorrectly in this case. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20887 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kim/lib/mac/KerberosLogin.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/kim/lib/mac/KerberosLogin.c b/src/kim/lib/mac/KerberosLogin.c index 47bb14253..de05e57dd 100644 --- a/src/kim/lib/mac/KerberosLogin.c +++ b/src/kim/lib/mac/KerberosLogin.c @@ -1446,11 +1446,18 @@ KLStatus KLCreatePrincipalFromTriplet (const char *inName, const char *inRealm, KLPrincipal *outPrincipal) { - return kl_check_error (kim_identity_create_from_components (outPrincipal, - inRealm, - inName, - inInstance, - NULL)); + if (inInstance && strlen (inInstance) > 0) { + return kl_check_error (kim_identity_create_from_components (outPrincipal, + inRealm, + inName, + inInstance, + NULL)); + } else { + return kl_check_error (kim_identity_create_from_components (outPrincipal, + inRealm, + inName, + NULL)); + } } /* ------------------------------------------------------------------------ */ -- 2.26.2