From: Todd C. Miller Date: Sat, 17 Jan 2004 21:34:05 +0000 (+0000) Subject: Change euid to runas user before calling find_path(). Unfortunately, X-Git-Tag: SUDO_1_6_8~229 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c8238172750d9fb539cdcc01ab452b10d11ffc34;p=sudo Change euid to runas user before calling find_path(). Unfortunately, though runas_user can be modified in sudoers we haven't parsed sudoers yet. --- diff --git a/sudo.c b/sudo.c index 51c66a636..ee762a1a4 100644 --- a/sudo.c +++ b/sudo.c @@ -572,8 +572,10 @@ init_vars(sudo_mode) /* Resolve the path and return. */ if ((sudo_mode & MODE_RUN)) { - /* XXX - should call this as runas user, not root. */ + /* XXX - default_runas may be modified during parsing of sudoers */ + set_perms(PERM_RUNAS); rval = find_path(NewArgv[0], &user_cmnd, user_path); + set_perms(PERM_ROOT); if (rval != FOUND) { /* Failed as root, try as invoking user. */ set_perms(PERM_USER);