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/login_auth.c | 566 +---------------------------------------------- 1 file changed, 1 insertion(+), 565 deletions(-) (limited to 'lib/libutil/login_auth.c') 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