* that we care about. Fills in pw_passwd from shadow file if necessary.
*/
struct passwd *
-sudo_pwdup(pw)
+sudo_pwdup(pw, checkshadow)
const struct passwd *pw;
+ int checkshadow;
{
char *cp;
const char *pw_passwd, *pw_shell;
struct passwd *newpw;
/* Get shadow password if available. */
- pw_passwd = sudo_getepw(pw);
+ pw_passwd = checkshadow ? sudo_getepw(pw) : pw->pw_passwd;
/* If shell field is empty, expand to _PATH_BSHELL. */
pw_shell = (pw->pw_shell == NULL || pw->pw_shell[0] == '\0')
if ((pw = getpwuid(uid)) == NULL)
return(NULL);
else
- return(sudo_pwdup(pw));
+ return(sudo_pwdup(pw, 1));
}
/*
if ((pw = getpwnam(name)) == NULL)
return(NULL);
else
- return(sudo_pwdup(pw));
+ return(sudo_pwdup(pw, 1));
}