exit(2);
}
- if (cache == NULL)
- cache = krb5_cc_default ();
+ if (cache == NULL) {
+ if (code = krb5_cc_default(&cache)) {
+ com_err(argv[0], code, "while getting default ccache");
+ exit(1);
+ }
+ }
code = krb5_cc_destroy (cache);
if (code != 0) {
com_err (argv[0], code, "while destroying cache");
+#ifdef __STDC__
+ fprintf(stderr, "Ticket cache \aNOT\a destroyed!\n");
+#else
fprintf(stderr, "Ticket cache \007NOT\007 destroyed!\n");
+#endif
exit (1);
}
exit (0);
errflg++;
if (errflg) {
- fprintf(stderr, "Usage: %s [ -rp ] [ -l lifetime ] [ -c cachename ] principal", argv[0]);
+ fprintf(stderr, "Usage: %s [ -rp ] [ -l lifetime ] [ -c cachename ] principal\n", argv[0]);
exit(2);
}
- if (ccache == NULL)
- ccache = krb5_cc_default();
-
+ if (ccache == NULL) {
+ if (code = krb5_cc_default(&ccache)) {
+ com_err(argv[0], code, "while getting default ccache");
+ exit(1);
+ }
+ }
if (code = krb5_parse_name (argv[optind], &me)) {
com_err (argv[0], code, "when parsing name %s",argv[optind]);
exit(1);
fprintf(stderr, "Usage: %s [ -c cache ]\n", argv[0]);
exit(2);
}
- if (cache == NULL)
- cache = krb5_cc_default();
+ if (cache == NULL) {
+ if (code = krb5_cc_default(&cache)) {
+ com_err(argv[0], code, "while getting default ccache");
+ exit(1);
+ }
+ }
flags = 0; /* turns off OPENCLOSE mode */
if (code = krb5_cc_set_flags(cache, flags)) {