From: Todd C. Miller Date: Thu, 27 Jan 1994 19:07:10 +0000 (+0000) Subject: added svr4 junk for shadow pws for solaris 2.x X-Git-Tag: SUDO_1_3_0~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a58183855f7f8dc5a7168a0f1431303b213f49fc;p=sudo added svr4 junk for shadow pws for solaris 2.x --- diff --git a/check.c b/check.c index 0f0fda177..39ec8398f 100644 --- a/check.c +++ b/check.c @@ -51,6 +51,9 @@ static char rcsid[] = "$Id$"; #include #include "sudo.h" #include "insults.h" +#ifdef __svr4__ +#include +#endif /* __svr4__ */ extern char *getpass(); @@ -195,6 +198,9 @@ static void check_passwd() char *crypt(); #endif /* linux */ struct passwd *pw_ent; +#ifdef __svr4__ + struct spwd *spw_ent; +#endif /* __svr4__ */ char *encrypted; /* this comes from /etc/passwd */ char *pass; /* this is what gets entered */ register int counter = TRIES_FOR_PASSWORD; @@ -205,7 +211,17 @@ static void check_passwd() inform_user(GLOBAL_NO_PW_ENT); exit(1); } +#ifdef __svr4__ + if ((spw_ent = getspnam(pw_ent->pw_name)) == NULL) { + (void) sprintf(user, "%u", uid); + log_error(GLOBAL_NO_PW_ENT); + inform_user(GLOBAL_NO_PW_ENT); + exit(1); + } + encrypted = spw_ent -> sp_pwdp; +#else encrypted = pw_ent -> pw_passwd; +#endif /* __svr4__ */ /* * you get TRIES_FOR_PASSWORD times to guess your password