2
0
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:
Todd C. Miller
2012-04-23 16:38:16 -04:00
parent 1480bb88b7
commit 23b7a1fa5c
8 changed files with 43 additions and 32 deletions

View File

@@ -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: