mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Call the policy's init_session() function before we fork the child.
That way, the session is created and destroyed in the same process, which is needed by some modules, such as pam_mount.
This commit is contained in:
@@ -620,6 +620,13 @@ fork_pty(struct command_details *details, int sv[], int *maxfd)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The policy plugin's session init must be run before we fork
|
||||
* or certain pam modules won't be able to track their state.
|
||||
*/
|
||||
if (policy_init_session(details) != true)
|
||||
errorx(1, _("policy plugin failed session initialization"));
|
||||
|
||||
child = sudo_debug_fork();
|
||||
switch (child) {
|
||||
case -1:
|
||||
|
Reference in New Issue
Block a user