tty: Make sure the controlling terminal is restored by session leader
The controling terminal should be sestored by a session leader, thus we need to test if the SID we've found in process tree is a leader. Otherwise we might have pretty interesting situation: the user passed -j on dump, ie telling us to inherit shell jobs and on restore procedure the SID get inherited from the crtools but session leader for this sid doesn't belong to our peocess tree and thus we should not try to restore controlling terminal but inherit it as well. Reported-by:Andrey Vagin <avagin@openvz.org> Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Acked-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
Showing
Please
register
or
sign in
to comment