Use KJH's auth.conf parser to turn on/off Kerberos in userland.

This commit is contained in:
markm 1998-10-09 06:47:57 +00:00
parent a486b8dd50
commit 7536318c13
6 changed files with 24 additions and 8 deletions

View File

@ -1,5 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 7/19/93
# $Id: Makefile,v 1.11 1998/09/05 00:31:38 jb Exp $
# $Id: Makefile,v 1.12 1998/09/19 22:42:05 obrien Exp $
PROG= rlogin
SRCS= rlogin.c
@ -10,13 +10,13 @@ INSTALLFLAGS=-fschg
.if exists(${DESTDIR}${LIBDIR}/libkrb.a) && defined(MAKE_KERBEROS4)
SRCS+= krcmd.c kcmd.c rcmd_util.c encrypt.c
DPADD= ${LIBKRB} ${LIBDES} ${LIBCRYPT}
DPADD= ${LIBUTIL} ${LIBKRB} ${LIBDES} ${LIBCRYPT}
CFLAGS+=-DKERBEROS -DCRYPT -DHAVE_CONFIG_H \
-I${.CURDIR}/../../kerberosIV/include \
-I${.CURDIR}/../../crypto/kerberosIV/include \
-I${.CURDIR}/../../crypto/kerberosIV/lib/roken \
-I${.CURDIR}/../../crypto/kerberosIV/appl/bsd
LDADD= -lkrb -ldes -lcrypt
LDADD= -lutil -lkrb -ldes -lcrypt
DISTRIBUTION= krb
.PATH: ${.CURDIR}/../../crypto/kerberosIV/appl/bsd
.endif

View File

@ -194,6 +194,7 @@ Determines the user's terminal type.
.Bl -tag -width /etc/hosts -compact
.It Pa /etc/hosts
.It Pa /etc/hosts.equiv
.It Pa /etc/auth.conf
.It Pa $HOME/.rhosts
.It Pa $HOME/.klogin
.El

View File

@ -40,7 +40,7 @@ static const char copyright[] =
#ifndef lint
static const char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
static const char rcsid[] =
"$Id$";
"$Id: rlogin.c,v 1.17 1998/03/26 18:03:41 markm Exp $";
#endif /* not lint */
/*
@ -60,6 +60,7 @@ static const char rcsid[] =
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <libutil.h>
#include <netdb.h>
#include <pwd.h>
#include <setjmp.h>
@ -150,6 +151,9 @@ main(argc, argv)
long omask;
int argoff, ch, dflag, Dflag, one, uid;
char *host, *p, *user, term[1024];
#ifdef KERBEROS
char *k;
#endif
argoff = dflag = Dflag = 0;
one = 1;
@ -236,6 +240,9 @@ main(argc, argv)
sp = NULL;
#ifdef KERBEROS
k = auth_getval("auth_list");
if (k && !strstr(k, "kerberos"))
use_kerberos = 0;
if (use_kerberos) {
sp = getservbyname((doencrypt ? "eklogin" : "klogin"), "tcp");
if (sp == NULL) {

View File

@ -1,5 +1,5 @@
# @(#)Makefile 8.1 (Berkeley) 7/19/93
# $Id: Makefile,v 1.7 1998/09/05 00:32:27 jb Exp $
# $Id: Makefile,v 1.8 1998/09/19 22:42:05 obrien Exp $
PROG= rsh
SRCS= rsh.c
@ -13,8 +13,8 @@ CFLAGS+=-DKERBEROS -DCRYPT -DHAVE_CONFIG_H \
-I${.CURDIR}/../../crypto/kerberosIV/include \
-I${.CURDIR}/../../crypto/kerberosIV/lib/roken \
-I${.CURDIR}/../../crypto/kerberosIV/appl/bsd
DPADD= ${LIBKRB} ${LIBDES} ${LIBCRYPT}
LDADD= -lkrb -ldes -lcrypt
DPADD= ${LIBUTIL} ${LIBKRB} ${LIBDES} ${LIBCRYPT}
LDADD= -lutil -lkrb -ldes -lcrypt
DISTRIBUTION= krb
.PATH: ${.CURDIR}/../../crypto/kerberosIV/appl/bsd
.endif

View File

@ -132,6 +132,7 @@ to
.Sh FILES
.Bl -tag -width /etc/hosts -compact
.It Pa /etc/hosts
.It Pa /etc/auth.conf
.El
.Sh SEE ALSO
.Xr rlogin 1 ,

View File

@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "From: @(#)rsh.c 8.3 (Berkeley) 4/6/94";
#endif
static const char rcsid[] =
"$Id: rsh.c,v 1.14 1998/02/20 04:50:50 jb Exp $";
"$Id: rsh.c,v 1.15 1998/03/23 07:46:23 charnier Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -57,6 +57,7 @@ static const char rcsid[] =
#include <err.h>
#include <errno.h>
#include <libutil.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
@ -102,6 +103,9 @@ main(argc, argv)
uid_t uid;
char *args, *host, *p, *user;
int timeout = 0;
#ifdef KERBEROS
char *k;
#endif
argoff = asrsh = dflag = nflag = 0;
one = 1;
@ -207,6 +211,9 @@ main(argc, argv)
sp = NULL;
#ifdef KERBEROS
k = auth_getval("auth_list");
if (k && !strstr(k, "kerberos"))
use_kerberos = 0;
if (use_kerberos) {
sp = getservbyname((doencrypt ? "ekshell" : "kshell"), "tcp");
if (sp == NULL) {