svn rev #23098: trunk/src/clients/kinit/

raeburn@MIT.EDU raeburn at MIT.EDU
Fri Oct 30 19:08:45 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=23098
Commit By: raeburn
Log Message:
If krb5_sname_to_principal returns a null realm for the client
principal name, print an error message.


Changed Files:
U   trunk/src/clients/kinit/kinit.c
Modified: trunk/src/clients/kinit/kinit.c
===================================================================
--- trunk/src/clients/kinit/kinit.c	2009-10-30 23:08:40 UTC (rev 23097)
+++ trunk/src/clients/kinit/kinit.c	2009-10-30 23:08:45 UTC (rev 23098)
@@ -480,6 +480,16 @@
 		    "when creating default server principal name");
 	    return 0;
 	  }
+	  if (k5->me->realm.data[0] == 0) {
+	      code = krb5_unparse_name(k5->ctx, k5->me, &k5->name);
+	      if (code == 0)
+		  com_err(progname, KRB5_ERR_HOST_REALM_UNKNOWN,
+			  "(principal %s)", k5->name);
+	      else
+		  com_err(progname, KRB5_ERR_HOST_REALM_UNKNOWN,
+			  "for local services");
+	      return 0;
+	  }
 	} else {
 	  /* Get default principal from cache if one exists */
 	  code = krb5_cc_get_principal(k5->ctx, k5->cc, 




More information about the cvs-krb5 mailing list