pstree: when updating sid for shell job also update matching pgid

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 <ptikhomirov@virtuozzo.com>
This commit is contained in:
Pavel Tikhomirov 2022-01-27 10:28:29 +03:00 committed by Andrei Vagin
parent 89267dbcc8
commit fdf4fda200

View file

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