/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*
* Copyright 1990 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* 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
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* 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.
*/
#include <krb5.h>
#include <com_err.h>
#include <string.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <locale.h>
#include <rpc/rpcsec_gss.h>
#include <syslog.h>
#include <libintl.h>
#ifdef KRB5_KRB4_COMPAT
#include <kerberosIV/krb.h>
#endif
#ifdef __STDC__
#else
#endif
extern int optind;
extern char *optarg;
#ifndef _WIN32
#else
#endif
char *progname;
int got_k5 = 0;
int got_k4 = 0;
#ifdef KRB5_KRB4_COMPAT
#else
int default_k4 = 0;
#endif
static void usage()
{
progname);
exit(2);
}
int
int argc;
char **argv;
{
int c;
int code = 0;
#ifdef KRB5_KRB4_COMPAT
int v4code = 0;
#endif
int errflg = 0;
int quiet = 0;
{9, "\052\206\110\206\367\022\001\002\002"};
int use_k5 = 0;
int use_k4 = 0;
/* set locale and domain for internationalization */
#if !defined(TEXT_DOMAIN)
#endif /* !TEXT_DOMAIN */
(void) textdomain(TEXT_DOMAIN);
got_k5 = 1;
#ifdef KRB5_KRB4_COMPAT
got_k4 = 1;
#endif
switch (c) {
case 'q':
quiet = 1;
break;
case 'c':
if (cache_name) {
errflg++;
} else {
cache_name = optarg;
}
break;
case '4':
if (!got_k4)
{
#ifdef KRB5_KRB4_COMPAT
#else
#endif
exit(3);
}
use_k4 = 1;
break;
case '5':
if (!got_k5)
{
exit(3);
}
use_k5 = 1;
break;
case '?':
default:
errflg++;
break;
}
}
errflg++;
if (errflg) {
usage();
}
{
use_k5 = default_k5;
use_k4 = default_k4;
}
if (!use_k5)
got_k5 = 0;
if (!use_k4)
got_k4 = 0;
if (got_k5) {
if (retval) {
exit(1);
}
/*
* Solaris Kerberos
* Let us destroy the kernel cache first
*/
if (code != 0) {
gettext("%s: kernel creds cache error %d \n"),
}
gettext("while getting default ccache"));
exit(1);
}
}
if (cache_name) {
#ifdef KRB5_KRB4_COMPAT
v4 = 0; /* Don't do v4 if doing v5 and cache name given. */
#endif
if (code != 0) {
exit(1);
}
} else {
if (code) {
exit(1);
}
}
/*
* Solaris Kerberos
* Get client name for kwarn_del_warning.
*/
if (code != 0)
("%s: Could not obtain principal name from cache\n"), progname);
else
("%s: Could not unparse principal name found in cache\n"), progname);
if (code != 0) {
if (code != KRB5_FCC_NOFILE) {
if (quiet)
else {
}
errflg = 1;
}
}
}
#ifdef KRB5_KRB4_COMPAT
if (quiet)
else
errflg = 1;
}
}
#endif
/* Solaris Kerberos */
if (!errflg && client_name)
else
("%s: TGT expire warning NOT deleted\n"), progname);
return errflg;
}