diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 1997-02-05 04:29:56 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 1997-02-05 04:29:56 +0000 |
commit | 860c2cf2bc6592828a3468ab8ee661042b059ae8 (patch) | |
tree | fde30676422ab07fdec2d11fde3fc5693fdbb8cf /eBones/usr.bin/kinit | |
parent | b61013aa0c73c687493c80193bc040d29b351fb8 (diff) |
This commit was manufactured by cvs2svn to create tagupstream/2.1.6_cvsrelease/2.1.6_cvs
'RELENG_2_1_6_RELEASE'.
This commit was manufactured to restore the state of the 2.1.6-RELEASE image.
Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'eBones/usr.bin/kinit')
-rw-r--r-- | eBones/usr.bin/kinit/Makefile | 10 | ||||
-rw-r--r-- | eBones/usr.bin/kinit/kinit.1 | 133 | ||||
-rw-r--r-- | eBones/usr.bin/kinit/kinit.c | 224 |
3 files changed, 0 insertions, 367 deletions
diff --git a/eBones/usr.bin/kinit/Makefile b/eBones/usr.bin/kinit/Makefile deleted file mode 100644 index 94549dceb4ec..000000000000 --- a/eBones/usr.bin/kinit/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# From: @(#)Makefile 5.1 (Berkeley) 6/25/90 -# $Id: Makefile,v 1.5 1995/09/14 04:06:11 gibbs Exp $ - -PROG= kinit -CFLAGS+=-DKERBEROS -DDEBUG -DBSD42 -DPADD= ${LIBKRB} ${LIBDES} -LDADD= -L${KRBOBJDIR} -lkrb -L${DESOBJDIR} -ldes -MAN1= kinit.1 - -.include <bsd.prog.mk> diff --git a/eBones/usr.bin/kinit/kinit.1 b/eBones/usr.bin/kinit/kinit.1 deleted file mode 100644 index f9a97a738201..000000000000 --- a/eBones/usr.bin/kinit/kinit.1 +++ /dev/null @@ -1,133 +0,0 @@ -.\" from: kinit.1,v 4.6 89/01/23 11:39:11 jtkohl Exp $ -.\" $Id: kinit.1,v 1.2 1994/07/19 19:27:36 g89r4222 Exp $ -.\" Copyright 1989 by the Massachusetts Institute of Technology. -.\" -.\" For copying and distribution information, -.\" please see the file <Copyright.MIT>. -.\" -.TH KINIT 1 "Kerberos Version 4.0" "MIT Project Athena" -.SH NAME -kinit \- Kerberos login utility -.SH SYNOPSIS -.B kinit -[ -.B \-irvl -] -.SH DESCRIPTION -The -.I kinit -command is used to login to the -Kerberos -authentication and authorization system. -Note that only registered -Kerberos -users can use the -Kerberos -system. -For information about registering as a -Kerberos -user, -see the -.I kerberos(1) -manual page. -.PP -If you are logged in to a workstation that is running the -.I toehold -service, -you do not have to use -.I kinit. -The -.I toehold -login procedure will log you into -Kerberos -automatically. -You will need to use -.I kinit -only in those situations in which -your original tickets have expired. -(Tickets expire in about a day.) -Note as well that -.I toehold -will automatically destroy your tickets when you logout from the workstation. -.PP -When you use -.I kinit -without options, -the utility -prompts for your username and Kerberos password, -and tries to authenticate your login with the local -Kerberos -server. -.PP -If -Kerberos -authenticates the login attempt, -.I kinit -retrieves your initial ticket and puts it in the ticket file specified by -your KRBTKFILE environment variable. -If this variable is undefined, -your ticket will be stored in the -.IR /tmp -directory, -in the file -.I tktuid , -where -.I uid -specifies your user identification number. -.PP -If you have logged in to -Kerberos -without the benefit of the workstation -.I toehold -system, -make sure you use the -.I kdestroy -command to destroy any active tickets before you end your login session. -You may want to put the -.I kdestroy -command in your -.I \.logout -file so that your tickets will be destroyed automatically when you logout. -.PP -The options to -.I kinit -are as follows: -.TP 7 -.B \-i -.I kinit -prompts you for a -Kerberos -instance. -.TP -.B \-r -.I kinit -prompts you for a -Kerberos -realm. -This option lets you authenticate yourself with a remote -Kerberos -server. -.TP -.B \-v -Verbose mode. -.I kinit -prints the name of the ticket file used, and -a status message indicating the success or failure of -your login attempt. -.TP -.B \-l -.I kinit -prompts you for a ticket lifetime in minutes. Due to protocol -restrictions in Kerberos Version 4, this value must be between 5 and -1275 minutes. -.SH SEE ALSO -.PP -kerberos(1), kdestroy(1), klist(1), toehold(1) -.SH BUGS -The -.B \-r -option has not been fully implemented. -.SH AUTHORS -Steve Miller, MIT Project Athena/Digital Equipment Corporation -.br -Clifford Neuman, MIT Project Athena diff --git a/eBones/usr.bin/kinit/kinit.c b/eBones/usr.bin/kinit/kinit.c deleted file mode 100644 index 66a6f7f2c3d7..000000000000 --- a/eBones/usr.bin/kinit/kinit.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 1987, 1988 by the Massachusetts Institute of Technology. - * For copying and distribution information, please see the file - * <Copyright.MIT>. - * - * Routine to initialize user to Kerberos. Prompts optionally for - * user, instance and realm. Authenticates user and gets a ticket - * for the Kerberos ticket-granting service for future use. - * - * Options are: - * - * -i[instance] - * -r[realm] - * -v[erbose] - * -l[ifetime] - * - * from: kinit.c,v 4.12 90/03/20 16:11:15 jon Exp $ - * $Id$ - */ - -#if 0 -#ifndef lint -static char rcsid[] = -"$Id$"; -#endif lint -#endif - -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> -#include <pwd.h> -#include <krb.h> - -#ifndef ORGANIZATION -#define ORGANIZATION "MIT Project Athena" -#endif /*ORGANIZATION*/ - -#ifdef PC -#define LEN 64 /* just guessing */ -#endif PC - -#if defined(BSD42) || defined(__FreeBSD__) || defined(__NetBSD__) -#include <strings.h> -#include <sys/param.h> -#if defined(ultrix) || defined(sun) -#define LEN 64 -#else -#define LEN MAXHOSTNAMELEN -#endif /* defined(ultrix) || defined(sun) */ -#endif /* BSD42 */ - -#define LIFE 96 /* lifetime of ticket in 5-minute units */ - -char *progname; - -void usage(void); - -void -get_input(s, size, stream) -char *s; -int size; -FILE *stream; -{ - char *p; - - if (fgets(s, size, stream) == NULL) - exit(1); - if ((p = index(s, '\n')) != NULL) - *p = '\0'; -} - -int -main(argc, argv) - int argc; - char *argv[]; -{ - char aname[ANAME_SZ]; - char inst[INST_SZ]; - char realm[REALM_SZ]; - char buf[LEN]; - char *username = NULL; - int iflag, rflag, vflag, lflag, lifetime, k_errno; - register char *cp; - register i; - - *inst = *realm = '\0'; - iflag = rflag = vflag = lflag = 0; - lifetime = LIFE; - progname = (cp = rindex(*argv, '/')) ? cp + 1 : *argv; - - while (--argc) { - if ((*++argv)[0] != '-') { - if (username) - usage(); - username = *argv; - continue; - } - for (i = 1; (*argv)[i] != '\0'; i++) - switch ((*argv)[i]) { - case 'i': /* Instance */ - ++iflag; - continue; - case 'r': /* Realm */ - ++rflag; - continue; - case 'v': /* Verbose */ - ++vflag; - continue; - case 'l': - ++lflag; - continue; - default: - usage(); - exit(1); - } - } - if (username && - (k_errno = kname_parse(aname, inst, realm, username)) - != KSUCCESS) { - fprintf(stderr, "%s: %s\n", progname, krb_err_txt[k_errno]); - iflag = rflag = 1; - username = NULL; - } - if (k_gethostname(buf, LEN)) { - fprintf(stderr, "%s: k_gethostname failed\n", progname); - exit(1); - } - printf("%s (%s)\n", ORGANIZATION, buf); - if (username) { - printf("Kerberos Initialization for \"%s", aname); - if (*inst) - printf(".%s", inst); - if (*realm) - printf("@%s", realm); - printf("\"\n"); - } else { - if (iflag) { - printf("Kerberos Initialization\n"); - printf("Kerberos name: "); - get_input(aname, sizeof(aname), stdin); - } else { - int uid = getuid(); - char *getenv(); - struct passwd *pwd; - - /* default to current user name unless running as root */ - if (uid == 0 && (username = getenv("USER")) && - strcmp(username, "root") != 0) { - strncpy(aname, username, sizeof(aname)); - strncpy(inst, "root", sizeof(inst)); - } else { - pwd = getpwuid(uid); - - if (pwd == (struct passwd *) NULL) { - fprintf(stderr, "Unknown name for your uid\n"); - printf("Kerberos name: "); - get_input(aname, sizeof(aname), stdin); - } else - strncpy(aname, pwd->pw_name, sizeof(aname)); - } - } - - if (!*aname) - exit(0); - if (!k_isname(aname)) { - fprintf(stderr, "%s: bad Kerberos name format\n", - progname); - exit(1); - } - } - /* optional instance */ - if (iflag) { - printf("Kerberos instance: "); - get_input(inst, sizeof(inst), stdin); - if (!k_isinst(inst)) { - fprintf(stderr, "%s: bad Kerberos instance format\n", - progname); - exit(1); - } - } - if (rflag) { - printf("Kerberos realm: "); - get_input(realm, sizeof(realm), stdin); - if (!k_isrealm(realm)) { - fprintf(stderr, "%s: bad Kerberos realm format\n", - progname); - exit(1); - } - } - if (lflag) { - printf("Kerberos ticket lifetime (minutes): "); - get_input(buf, sizeof(buf), stdin); - lifetime = atoi(buf); - if (lifetime < 5) - lifetime = 1; - else - lifetime /= 5; - /* This should be changed if the maximum ticket lifetime */ - /* changes */ - if (lifetime > 255) - lifetime = 255; - } - if (!*realm && krb_get_lrealm(realm, 1)) { - fprintf(stderr, "%s: krb_get_lrealm failed\n", progname); - exit(1); - } - k_errno = krb_get_pw_in_tkt(aname, inst, realm, "krbtgt", realm, - lifetime, 0); - if (vflag) { - printf("Kerberos realm %s:\n", realm); - printf("%s\n", krb_err_txt[k_errno]); - } else if (k_errno) { - fprintf(stderr, "%s: %s\n", progname, krb_err_txt[k_errno]); - exit(1); - } - return 0; -} - -void -usage() -{ - fprintf(stderr, "Usage: %s [-irvl] [name]\n", progname); - exit(1); -} |