From a20f23f7912020224b8484adcd99b2688df0f2e7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 17 Oct 1998 22:08:29 +0000 Subject: [PATCH] moved SecureWare stuff into secureware.c --- check.c | 45 +++------------------------------------------ 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/check.c b/check.c index 3d5f46118..ffb36cb07 100644 --- a/check.c +++ b/check.c @@ -66,14 +66,6 @@ static char rcsid[] = "$Id$"; #include "sudo.h" #include "insults.h" #include "version.h" -#ifdef HAVE_GETPRPWUID -# ifdef __hpux -# include -# else -# include -# endif /* __hpux */ -# include -#endif /* HAVE_GETPRPWUID */ #ifdef HAVE_KERB4 # include #endif /* HAVE_KERB4 */ @@ -140,9 +132,6 @@ struct skey skey; #ifdef HAVE_OPIE struct opie opie; #endif -#if defined(HAVE_GETPRPWUID) && defined(__alpha) -extern int crypt_type; -#endif /* HAVE_GETPRPWUID && __alpha */ @@ -585,43 +574,15 @@ static void check_passwd() /* * If we use shadow passwords with a different crypt(3) * check that here, else use standard crypt(3). - * XXX - break out into separate functions. */ # ifdef HAVE_GETAUTHUID if (!strcmp(user_passwd, (char *) crypt16(pass, user_passwd))) return; /* if the passwd is correct return() */ # endif /* HAVE_GETAUTHUID */ + # ifdef HAVE_GETPRPWUID -# ifndef __alpha -# ifdef HAVE_BIGCRYPT - if (strcmp(user_passwd, (char *) bigcrypt(pass, user_passwd)) == 0) - return; /* if the passwd is correct return() */ -# endif /* HAVE_BIGCRYPT */ -# else /* !__alpha */ - switch (crypt_type) { - case AUTH_CRYPT_BIGCRYPT: - if (!strcmp(user_passwd, bigcrypt(pass, user_passwd))) - return; /* if the passwd is correct return() */ - break; - case AUTH_CRYPT_CRYPT16: - if (!strcmp(user_passwd, crypt16(pass, user_passwd))) - return; /* if the passwd is correct return() */ - break; -# ifdef AUTH_CRYPT_OLDCRYPT - case AUTH_CRYPT_OLDCRYPT: - case AUTH_CRYPT_C1CRYPT: -# endif - case -1: - if (!strcmp(user_passwd, crypt(pass, user_passwd))) - return; /* if the passwd is correct return() */ - break; - default: - (void) fprintf(stderr, - "%s: Sorry, I don't know how to deal with crypt type %d.\n", - Argv[0], crypt_type); - exit(1); - } -# endif /* __alpha */ + if (check_secureware(pass)) + return; /* if the passwd is correct return() */ # endif /* HAVE_GETPRPWUID */ /* Normal UN*X password check */ -- 2.50.1