summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-05-02 18:27:22 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-05-02 18:27:22 +0000
commit37d1aac44f55f09421bbc8c6fb98cb3844bdf2a8 (patch)
treea07c418c1529023c5624044b8cff2bed84de639a
parentaf47f7b9513d28c35c99a3b5cd0f4e6b6abbeaa4 (diff)
downloadkrb5-37d1aac44f55f09421bbc8c6fb98cb3844bdf2a8.tar.gz
krb5-37d1aac44f55f09421bbc8c6fb98cb3844bdf2a8.tar.xz
krb5-37d1aac44f55f09421bbc8c6fb98cb3844bdf2a8.zip
convert to macro-ized function style
print better error msgs when no cache git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@680 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/clients/klist/klist.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c
index fdbc7879f..6b3ab3a0e 100644
--- a/src/clients/klist/klist.c
+++ b/src/clients/klist/klist.c
@@ -23,6 +23,7 @@ static char rcsid_klist_c [] =
#include <krb5/isode_err.h>
#include <krb5/ext-proto.h>
#include <com_err.h>
+#include <errno.h>
extern int optind;
extern char *optarg;
@@ -84,11 +85,17 @@ main(argc, argv)
cache = krb5_cc_default();
flags = 0; /* turns off OPENCLOSE mode */
- if (code = (*cache->ops->set_flags)(cache, flags)) {
- com_err(argv[0], code, "while setting cache flags");
+ if (code = krb5_cc_set_flags(cache, flags)) {
+ if (code == ENOENT) {
+ com_err(argv[0], code, "(ticket cache %s)",
+ krb5_cc_get_name(cache));
+ } else
+ com_err(argv[0], code,
+ "while setting cache flags (ticket cache %s)",
+ krb5_cc_get_name(cache));
exit(1);
}
- if (code = (*cache->ops->get_princ)(cache, &princ)) {
+ if (code = krb5_cc_get_principal(cache, &princ)) {
com_err(argv[0], code, "while retrieving principal name");
exit(1);
}
@@ -99,11 +106,11 @@ main(argc, argv)
printf("Ticket cache: %s\nDefault principal: %s\n",
(*cache->ops->get_name)(cache), name);
free(name);
- if (code = (*cache->ops->get_first)(cache, &cur)) {
+ if (code = krb5_cc_start_seq_get(cache, &cur)) {
com_err(argv[0], code, "while starting to retrieve tickets");
exit(1);
}
- while (!(code = (*cache->ops->get_next)(cache, &cur, &creds))) {
+ while (!(code = krb5_cc_next_cred(cache, &cur, &creds))) {
code = krb5_unparse_name(creds.client, &name);
if (code) {
com_err(argv[0], code, "while unparsing client name");
@@ -118,7 +125,7 @@ main(argc, argv)
printf("C: %s\tS:%s\n", name, sname);
}
if (code == KRB5_CC_END) {
- if (code = (*cache->ops->end_get)(cache, &cur)) {
+ if (code = krb5_cc_end_seq_get(cache, &cur)) {
com_err(argv[0], code, "while finishing ticket retrieval");
exit(1);
}