diff options
Diffstat (limited to 'eBones/usr.bin/kdestroy')
-rw-r--r-- | eBones/usr.bin/kdestroy/Makefile | 11 | ||||
-rw-r--r-- | eBones/usr.bin/kdestroy/kdestroy.1 | 81 | ||||
-rw-r--r-- | eBones/usr.bin/kdestroy/kdestroy.c | 78 |
3 files changed, 170 insertions, 0 deletions
diff --git a/eBones/usr.bin/kdestroy/Makefile b/eBones/usr.bin/kdestroy/Makefile new file mode 100644 index 0000000..5947028 --- /dev/null +++ b/eBones/usr.bin/kdestroy/Makefile @@ -0,0 +1,11 @@ +# From: @(#)Makefile 5.1 (Berkeley) 6/25/90 +# $Id: Makefile,v 1.2 1994/07/19 19:24:15 g89r4222 Exp $ + +PROG= kdestroy +CFLAGS+=-DKERBEROS -DDEBUG -I${.CURDIR}/../include -DBSD42 +DPADD= ${LIBKRB} ${LIBDES} +LDADD= -L${KRBOBJDIR} -lkrb -L${DESOBJDIR} -ldes +BINDIR= /usr/bin +NOMAN= noman + +.include <bsd.prog.mk> diff --git a/eBones/usr.bin/kdestroy/kdestroy.1 b/eBones/usr.bin/kdestroy/kdestroy.1 new file mode 100644 index 0000000..7099353 --- /dev/null +++ b/eBones/usr.bin/kdestroy/kdestroy.1 @@ -0,0 +1,81 @@ +.\" from: kdestroy.1,v 4.9 89/01/23 11:39:50 jtkohl Exp $ +.\" $Id: kdestroy.1,v 1.2 1994/07/19 19:27:32 g89r4222 Exp $ +.\" Copyright 1989 by the Massachusetts Institute of Technology. +.\" +.\" For copying and distribution information, +.\" please see the file <Copyright.MIT>. +.\" +.TH KDESTROY 1 "Kerberos Version 4.0" "MIT Project Athena" +.SH NAME +kdestroy \- destroy Kerberos tickets +.SH SYNOPSIS +.B kdestroy +[ +.B \-f +] +[ +.B \-q +] +.SH DESCRIPTION +The +.I kdestroy +utility destroys the user's active +Kerberos +authorization tickets by writing zeros to the file that contains them. +If the ticket file does not exist, +.I kdestroy +displays a message to that effect. +.PP +After overwriting the file, +.I kdestroy +removes the file from the system. +The utility +displays a message indicating the success or failure of the +operation. +If +.I kdestroy +is unable to destroy the ticket file, +the utility will warn you by making your terminal beep. +.PP +In the Athena workstation environment, +the +.I toehold +service automatically destroys your tickets when you +end a workstation session. +If your site does not provide a similar ticket-destroying mechanism, +you can place the +.I kdestroy +command in your +.I .logout +file so that your tickets are destroyed automatically +when you logout. +.PP +The options to +.I kdestroy +are as follows: +.TP 7 +.B \-f +.I kdestroy +runs without displaying the status message. +.TP +.B \-q +.I kdestroy +will not make your terminal beep if it fails to destroy the tickets. +.SH FILES +KRBTKFILE environment variable if set, otherwise +.br +/tmp/tkt[uid] +.SH SEE ALSO +kerberos(1), kinit(1), klist(1) +.SH BUGS +.PP +Only the tickets in the user's current ticket file are destroyed. +Separate ticket files are used to hold root instance and password +changing tickets. These files should probably be destroyed too, or +all of a user's tickets kept in a single ticket file. +.SH AUTHORS +Steve Miller, MIT Project Athena/Digital Equipment Corporation +.br +Clifford Neuman, MIT Project Athena +.br +Bill Sommerfeld, MIT Project Athena diff --git a/eBones/usr.bin/kdestroy/kdestroy.c b/eBones/usr.bin/kdestroy/kdestroy.c new file mode 100644 index 0000000..f010fcd --- /dev/null +++ b/eBones/usr.bin/kdestroy/kdestroy.c @@ -0,0 +1,78 @@ +/* + * Copyright 1987, 1988 by the Massachusetts Institute of Technology. + * For copying and distribution information, please see the file + * <Copyright.MIT>. + * + * This program causes Kerberos tickets to be destroyed. + * Options are: + * + * -q[uiet] - no bell even if tickets not destroyed + * -f[orce] - no message printed at all + * + * from: kdestroy.c,v 4.5 88/03/18 15:16:02 steiner Exp $ + * $Id: kdestroy.c,v 1.2 1994/07/19 19:24:16 g89r4222 Exp $ + */ + +#ifndef lint +static char rcsid[] = +"$Id: kdestroy.c,v 1.2 1994/07/19 19:24:16 g89r4222 Exp $"; +#endif lint + +#include <stdio.h> +#include <krb.h> +#ifdef BSD42 +#include <strings.h> +#endif BSD42 + + +static char *pname; + +static usage() +{ + fprintf(stderr, "Usage: %s [-f] [-q]\n", pname); + exit(1); +} + +main(argc, argv) + char *argv[]; +{ + int fflag=0, qflag=0, k_errno; + register char *cp; + + cp = rindex (argv[0], '/'); + if (cp == NULL) + pname = argv[0]; + else + pname = cp+1; + + if (argc > 2) + usage(); + else if (argc == 2) { + if (!strcmp(argv[1], "-f")) + ++fflag; + else if (!strcmp(argv[1], "-q")) + ++qflag; + else usage(); + } + + k_errno = dest_tkt(); + + if (fflag) { + if (k_errno != 0 && k_errno != RET_TKFIL) + exit(1); + else + exit(0); + } else { + if (k_errno == 0) + printf("Tickets destroyed.\n"); + else if (k_errno == RET_TKFIL) + fprintf(stderr, "No tickets to destroy.\n"); + else { + fprintf(stderr, "Tickets NOT destroyed.\n"); + if (!qflag) + fprintf(stderr, "\007"); + exit(1); + } + } + exit(0); +} |