2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

If invoked as sudoedit we can't just exec the command directly since

the temporary files need to be updated before sudo exits.
This commit is contained in:
Todd C. Miller
2014-01-03 16:41:25 -07:00
parent 38bf95a767
commit d013b23ce3

View File

@@ -378,9 +378,12 @@ sudo_execute(struct command_details *details, struct command_status *cstat)
utmp_user = details->utmp_user ? details->utmp_user : user_details.username;
sudo_debug_printf(SUDO_DEBUG_INFO, "allocate pty for I/O logging");
pty_setup(details->euid, user_details.tty, utmp_user);
} else if (!ISSET(details->flags, CD_SET_TIMEOUT) &&
} else if (!ISSET(details->flags, CD_SET_TIMEOUT|CD_SUDOEDIT) &&
policy_plugin.u.policy->close == NULL) {
/* If no I/O logging, timeout or policy close we can exec directly. */
/*
* If there is no policy close function, no I/O logging or pty,
* and we were not invoked as sudoedit, just exec directly.
*/
exec_cmnd(details, cstat, -1);
goto done;
}