now do set_perms(PERM_ROOT) before the getpwuid() in load_global()

to work around a problem is trusted hpux shadow passwords. yuck.
This commit is contained in:
Todd C. Miller
1995-03-29 22:59:47 +00:00
parent ba7c8ad185
commit fe19bcc7c1

5
sudo.c
View File

@@ -276,6 +276,7 @@ static void load_globals()
* loading the user & epasswd global variable from the passwd file * loading the user & epasswd global variable from the passwd file
* (must be done as root to get real passwd on some systems) * (must be done as root to get real passwd on some systems)
*/ */
set_perms(PERM_ROOT);
if ((pw_ent = getpwuid(uid)) == NULL) { if ((pw_ent = getpwuid(uid)) == NULL) {
(void) sprintf(user, "%u", uid); (void) sprintf(user, "%u", uid);
log_error(GLOBAL_NO_PW_ENT); log_error(GLOBAL_NO_PW_ENT);
@@ -293,9 +294,9 @@ static void load_globals()
/* /*
* We only want to be root when we absolutely need it. * We only want to be root when we absolutely need it.
* This will effectively do setreuid(0, uid) but for portability... * Since we set euid and ruid to 0 above, this will set the euid
* to the * uid of the caller so (ruid, euid) == (0, user's uid).
*/ */
set_perms(PERM_ROOT);
set_perms(PERM_USER); set_perms(PERM_USER);
#ifdef UMASK #ifdef UMASK