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:
8
sudo.c
8
sudo.c
@@ -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);
|
||||
|
Reference in New Issue
Block a user