Move script_setup() back to immediately before we drop privs and

call the new script_nextid() in its place, which will set
sudo_user.sessid for the logging functions.
This commit is contained in:
Todd C. Miller
2009-09-03 10:21:18 +00:00
parent 9329149032
commit ad9ab8dab2
3 changed files with 39 additions and 27 deletions

8
sudo.c
View File

@@ -461,9 +461,9 @@ main(argc, argv, envp)
validate_env_vars(sudo_user.env_vars);
}
/* Open tty and session ID as needed */
/* Get next session ID so we can log it. */
if (def_script)
script_setup();
script_nextid();
log_allowed(validated);
if (ISSET(sudo_mode, MODE_CHECK))
@@ -503,6 +503,10 @@ main(argc, argv, envp)
/* Must audit before uid change. */
audit_success(NewArgv);
/* Open tty as needed */
if (def_script)
script_setup();
/* Become specified user or root if executing a command. */
if (ISSET(sudo_mode, MODE_RUN))
set_perms(PERM_FULL_RUNAS);