Skip to content

Commit

Permalink
pstree: when updating sid for shell job also update matching pgid
Browse files Browse the repository at this point in the history
If we replace old_sid with current_sid we should also do same
replacement for matching pgid (=old_sid).

Reported in CRIU gitter by Younes Manton (@ymanton)

Signed-off-by: Pavel Tikhomirov <[email protected]>
  • Loading branch information
Snorch authored and avagin committed Apr 29, 2022
1 parent 89267db commit fdf4fda
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions criu/pstree.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ static int prepare_pstree_for_shell_job(pid_t pid)
for_each_pstree_item(pi) {
if (pi->sid == old_sid)
pi->sid = current_sid;

if (pi->pgid == old_sid)
pi->pgid = current_sid;
}

if (lookup_create_item(current_sid) == NULL)
Expand Down

0 comments on commit fdf4fda

Please sign in to comment.