From a9521339a7bd807b0dae35b4b70a0150df0bcd24 Mon Sep 17 00:00:00 2001 From: sheldonh Date: Fri, 13 Aug 1999 16:51:40 +0000 Subject: Axe LOGIN_CAP_AUTH. PR: 10115 Reported by: Gene Skonicki Requested by: jdp --- lib/libutil/Makefile | 1 - lib/libutil/login.conf.5 | 6 +- lib/libutil/login_auth.c | 566 +---------------------------------------------- 3 files changed, 2 insertions(+), 571 deletions(-) (limited to 'lib') diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index cc2afa1..cd2ff2f 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -4,7 +4,6 @@ LIB= util SHLIB_MAJOR= 2 SHLIB_MINOR= 2 CFLAGS+=-Wall -DLIBC_SCCS -I${.CURDIR} -I${.CURDIR}/../../sys -#CFLAGS+=-DLOGIN_CAP_AUTH SRCS= login.c login_tty.c logout.c logwtmp.c pty.c setproctitle.c \ login_cap.c login_class.c login_auth.c login_times.c login_ok.c \ _secure_path.c uucplock.c property.c auth.c realhostname.c diff --git a/lib/libutil/login.conf.5 b/lib/libutil/login.conf.5 index bc26b28..1f487ad 100644 --- a/lib/libutil/login.conf.5 +++ b/lib/libutil/login.conf.5 @@ -17,7 +17,7 @@ .\" 5. Modifications may be freely made to this file providing the above .\" conditions are met. .\" -.\" $Id: login.conf.5,v 1.15 1998/02/21 23:29:59 fenner Exp $ +.\" $Id: login.conf.5,v 1.16 1999/04/30 18:19:46 hoek Exp $ .\" .Dd November 22, 1996 .Dt LOGIN.CONF 5 @@ -200,10 +200,6 @@ ensure octal interpretation. .Sy Name Type Notes Description .It minpasswordlen number 6 The minimum length a local password may be. .\" .It approve program Program to approve login. -.It auth list passwd Allowed authentication styles. The first value is the -default style. -.It auth- list Allowed authentication styles for the -authentication type 'type'. .It copyright file File containing additional copyright information .\".It widepasswords bool false Use the wide password format. The wide password .\" format allows up to 128 significant characters in the password. diff --git a/lib/libutil/login_auth.c b/lib/libutil/login_auth.c index b0c617c3..15f5892 100644 --- a/lib/libutil/login_auth.c +++ b/lib/libutil/login_auth.c @@ -25,7 +25,7 @@ * * Low-level routines relating to the user capabilities database * - * $Id: login_auth.c,v 1.8 1997/07/19 04:47:05 davidn Exp $ + * $Id: login_auth.c,v 1.9 1998/09/16 04:17:47 imp Exp $ */ #include @@ -51,570 +51,6 @@ #include #include -#ifdef LOGIN_CAP_AUTH -/* - * Comment from BSDI's authenticate.c module: - * NOTE: THIS MODULE IS TO BE DEPRECATED. FUTURE VERSIONS OF BSD/OS WILL - * HAVE AN UPDATED API, THOUGH THESE FUNCTIONS WILL CONTINUE TO BE AVAILABLE - * FOR BACKWARDS COMPATABILITY - */ - - -#define AUTHMAXSPOOL (8 * 1024) /* Max size of authentication data */ -#define AUTHCOMM_FD 3 /* Handle used to read/write auth data */ - -struct rmfiles { - struct rmfiles *next; - char file[1]; -}; - -struct authopts { - struct authopts *next; - char opt[1]; -}; - -static char *spoolbuf = NULL; -static int spoolidx = 0; -static struct rmfiles *rmfirst = NULL; -static struct authopts *optfirst = NULL; - - -/* - * Setup a known environment for all authentication scripts. - */ - -static char *auth_environ[] = { - "PATH=" _PATH_DEFPATH, - "SHELL=" _PATH_BSHELL, - NULL, -}; - - - -/* - * nextline() - * Get the next line from the data buffer collected from - * the authentication program. This function relies on the - * fact that lines are nul terminated. - */ - -static char * -nextline(int *idx) -{ - char *ptr = NULL; - - if (spoolbuf != NULL && *idx < spoolidx) { - ptr = spoolbuf + *idx; - *idx += strlen(ptr) + 1; - } - return ptr; -} - - -/* - * spooldata() - * Read data returned on authentication backchannel and - * stuff it into our spool buffer. We also replace \n with nul - * to make parsing easier later. - */ - -static int -spooldata(int fd) -{ - - if (spoolbuf) - free(spoolbuf); - spoolidx = 0; - - if (spoolbuf == NULL && (spoolbuf = malloc(AUTHMAXSPOOL)) == NULL) - syslog(LOG_ERR, "authbuffer malloc: %m"); - - else while (spoolidx < sizeof(spoolbuf) - 1) { - int r = read(fd, spoolbuf + spoolidx, sizeof(spoolbuf)-spoolidx); - char *b; - - if (r <= 0) { - spoolbuf[spoolidx] = '\0'; - return 0; - } - /* - * Convert newlines into NULs to allow - * easier scanning of the file. - */ - while ((b = memchr(spoolbuf + spoolidx, '\n', r)) != NULL) - *b = '\0'; - spoolidx += r; - } - return -1; -} - - -/* - * auth_check() - * Starts an auth_script() for the given , with a class , - * style