From: John Kohl Date: Tue, 29 May 1990 15:00:56 +0000 (+0000) Subject: changes to krb5_cc_default() interface X-Git-Tag: krb5-1.0-alpha2~451 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=13d8b5929bcce22b328ea885fd6ff6821a7b72d4;p=krb5.git changes to krb5_cc_default() interface git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@956 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/clients/kdestroy/kdestroy.c b/src/clients/kdestroy/kdestroy.c index e57f0db08..5b1b9f682 100644 --- a/src/clients/kdestroy/kdestroy.c +++ b/src/clients/kdestroy/kdestroy.c @@ -73,13 +73,21 @@ main(argc, argv) 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); diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c index ab4864255..39149ec48 100644 --- a/src/clients/kinit/kinit.c +++ b/src/clients/kinit/kinit.c @@ -108,12 +108,15 @@ main(argc, argv) 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); diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index a752c61fe..4390680cc 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -78,8 +78,12 @@ main(argc, argv) 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)) {