]> granicus.if.org Git - sudo/commitdiff
moved SecureWare stuff into secureware.c
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 17 Oct 1998 22:08:29 +0000 (22:08 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 17 Oct 1998 22:08:29 +0000 (22:08 +0000)
check.c

diff --git a/check.c b/check.c
index 3d5f46118389708ec5ba47dc30559e0282fe81d1..ffb36cb0774615e6fb6ea5270e153608f325138c 100644 (file)
--- 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 <hpsecurity.h>
-#  else
-#    include <sys/security.h>
-#  endif /* __hpux */
-#  include <prot.h>
-#endif /* HAVE_GETPRPWUID */
 #ifdef HAVE_KERB4
 #  include <krb.h>
 #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 */