summaryrefslogtreecommitdiffstats
path: root/src/clients/kdestroy
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2009-10-31 00:48:38 +0000
committerTom Yu <tlyu@mit.edu>2009-10-31 00:48:38 +0000
commit02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b (patch)
tree61b9147863cd8be3eff63903dc36cae168254bd5 /src/clients/kdestroy
parent162ab371748cba0cc6f172419bd6e71fa04bb878 (diff)
downloadkrb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.gz
krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.xz
krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.zip
make mark-cstyle
make reindent git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/clients/kdestroy')
-rw-r--r--src/clients/kdestroy/kdestroy.c101
1 files changed, 51 insertions, 50 deletions
diff --git a/src/clients/kdestroy/kdestroy.c b/src/clients/kdestroy/kdestroy.c
index 3f2f326823..4741f1a350 100644
--- a/src/clients/kdestroy/kdestroy.c
+++ b/src/clients/kdestroy/kdestroy.c
@@ -1,3 +1,4 @@
+/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* clients/kdestroy/kdestroy.c
*
@@ -8,7 +9,7 @@
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
- *
+ *
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
@@ -22,7 +23,7 @@
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
- *
+ *
*
* Destroy the contents of your credential cache.
*/
@@ -81,70 +82,70 @@ main(argc, argv)
progname = GET_PROGNAME(argv[0]);
while ((c = getopt(argc, argv, "54qc:")) != -1) {
- switch (c) {
- case 'q':
- quiet = 1;
- break;
- case 'c':
- if (cache_name) {
- fprintf(stderr, "Only one -c option allowed\n");
- errflg++;
- } else {
- cache_name = optarg;
- }
- break;
- case '4':
- fprintf(stderr, "Kerberos 4 is no longer supported\n");
- exit(3);
- break;
- case '5':
- break;
- case '?':
- default:
- errflg++;
- break;
- }
+ switch (c) {
+ case 'q':
+ quiet = 1;
+ break;
+ case 'c':
+ if (cache_name) {
+ fprintf(stderr, "Only one -c option allowed\n");
+ errflg++;
+ } else {
+ cache_name = optarg;
+ }
+ break;
+ case '4':
+ fprintf(stderr, "Kerberos 4 is no longer supported\n");
+ exit(3);
+ break;
+ case '5':
+ break;
+ case '?':
+ default:
+ errflg++;
+ break;
+ }
}
if (optind != argc)
- errflg++;
-
+ errflg++;
+
if (errflg) {
- usage();
+ usage();
}
retval = krb5_init_context(&kcontext);
if (retval) {
- com_err(progname, retval, "while initializing krb5");
- exit(1);
+ com_err(progname, retval, "while initializing krb5");
+ exit(1);
}
if (cache_name) {
- code = krb5_cc_resolve (kcontext, cache_name, &cache);
- if (code != 0) {
- com_err (progname, code, "while resolving %s", cache_name);
- exit(1);
- }
+ code = krb5_cc_resolve (kcontext, cache_name, &cache);
+ if (code != 0) {
+ com_err (progname, code, "while resolving %s", cache_name);
+ exit(1);
+ }
} else {
- code = krb5_cc_default(kcontext, &cache);
- if (code) {
- com_err(progname, code, "while getting default ccache");
- exit(1);
- }
+ code = krb5_cc_default(kcontext, &cache);
+ if (code) {
+ com_err(progname, code, "while getting default ccache");
+ exit(1);
+ }
}
code = krb5_cc_destroy (kcontext, cache);
if (code != 0) {
- com_err (progname, code, "while destroying cache");
- if (code != KRB5_FCC_NOFILE) {
- if (quiet)
- fprintf(stderr, "Ticket cache NOT destroyed!\n");
- else {
- fprintf(stderr, "Ticket cache %cNOT%c destroyed!\n",
- BELL_CHAR, BELL_CHAR);
- }
- errflg = 1;
- }
+ com_err (progname, code, "while destroying cache");
+ if (code != KRB5_FCC_NOFILE) {
+ if (quiet)
+ fprintf(stderr, "Ticket cache NOT destroyed!\n");
+ else {
+ fprintf(stderr, "Ticket cache %cNOT%c destroyed!\n",
+ BELL_CHAR, BELL_CHAR);
+ }
+ errflg = 1;
+ }
}
return errflg;
}