Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > e16d0c94ff2c9e93ba4eea60f7b68478 > files > 41

krb5-1.6.1-70.el5_9.2.src.rpm

If the error message is going to be ambiguous, try to give the user some clue
by returning the last error reported by the OS.

--- krb5-1.4.3/src/clients/kinit/kinit.c	2006-02-06 13:50:06.000000000 -0500
+++ krb5-1.4.3/src/clients/kinit/kinit.c	2006-02-06 13:49:41.000000000 -0500
@@ -34,6 +34,7 @@
 #else
 #undef HAVE_KRB524
 #endif
+#include <errno.h>
 #include <string.h>
 #include <stdio.h>
 #include <time.h>
@@ -846,8 +847,14 @@
 
     code = krb5_cc_initialize(k5->ctx, k5->cc, k5->me);
     if (code) {
-	com_err(progname, code, "when initializing cache %s",
-		opts->k5_cache_name?opts->k5_cache_name:"");
+	if ((code == KRB5_CC_IO) && (errno != 0)) {
+	    com_err(progname, code, "when initializing cache %s: %s",
+		    opts->k5_cache_name?opts->k5_cache_name:"",
+		    strerror(errno));
+	} else {
+	    com_err(progname, code, "when initializing cache %s",
+		    opts->k5_cache_name?opts->k5_cache_name:"");
+	}
 	goto cleanup;
     }