Sophie

Sophie

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

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

If we encounter any errors reading the user's principal name from the default
ccache, fall back to the default of using the current user's name.
diff -up krb5-1.6.1/src/clients/kpasswd/kpasswd.c krb5-1.6.1/src/clients/kpasswd/kpasswd.c
--- krb5-1.6.1/src/clients/kpasswd/kpasswd.c	2007-07-25 02:46:57.000000000 -0400
+++ krb5-1.6.1/src/clients/kpasswd/kpasswd.c	2007-07-25 02:47:26.000000000 -0400
@@ -84,21 +84,23 @@ int main(int argc, char *argv[])
 	 exit(1);
       }
    } else if ((ret = krb5_cc_default(context, &ccache)) != KRB5_CC_NOTFOUND) {
+      princ = NULL;
+
       if (ret) {
 	 com_err(argv[0], ret, "opening default ccache");
-	 exit(1);
       }
+      else
 
       if ((ret = krb5_cc_get_principal(context, ccache, &princ))) {
 	 com_err(argv[0], ret, "getting principal from ccache");
-	 exit(1);
       }
+      else
 
       if ((ret = krb5_cc_close(context, ccache))) {
 	 com_err(argv[0], ret, "closing ccache");
-	 exit(1);
       }
-   } else {
+   }
+   if (princ == NULL) {
        get_name_from_passwd_file(argv[0], context, &princ);
    }