#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 */
#ifdef HAVE_OPIE
struct opie opie;
#endif
-#if defined(HAVE_GETPRPWUID) && defined(__alpha)
-extern int crypt_type;
-#endif /* HAVE_GETPRPWUID && __alpha */
/*
* 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 */