krb5/krb5-1.8-kpasswd_ccache.patch
Nalin Dahyabhai 75b08040ff - update to 1.8
- temporarily bundling the krb5-appl package (split upstream as of 1.8)
    until its package review is complete
- profile.d scriptlets are now only needed by -workstation-clients
- adjust paths in init scripts
- drop upstreamed fix for KDC denial of service (CVE-2010-0283)
- drop patch to check the user's password correctly using crypt(), which
    isn't a code path we hit when we're using PAM
2010-03-05 22:19:38 +00:00

35 lines
1.2 KiB
Diff

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.8/src/clients/kpasswd/kpasswd.c.kpasswd-ccache krb5-1.8/src/clients/kpasswd/kpasswd.c
--- krb5-1.8/src/clients/kpasswd/kpasswd.c.kpasswd-ccache 2009-10-30 20:48:38.000000000 -0400
+++ krb5-1.8/src/clients/kpasswd/kpasswd.c 2010-03-05 11:04:42.000000000 -0500
@@ -85,21 +85,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);
}