fix #1819: fork_worker: ensure sync'ed workers control terminal
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 29 Jun 2018 09:21:18 +0000 (11:21 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 29 Jun 2018 09:36:01 +0000 (11:36 +0200)
commite97f807c388c10250f442b1f16c5315df2ffc2af
treedfda69983537eaa122fba80bea310adf180324b1
parentf53ad23ac974cf6677e1eb3faa44a2f61b8e1040
fix #1819: fork_worker: ensure sync'ed workers control terminal

Use setpgid + tcsetpgrp instead of setsid if $sync (invocation via
cli), thus keeping /dev/tty - ssh-copy-id/ssh need it to read the
password, and putting the child in the forground. Further, ignore
SIGTTOU in child process (otherwise it gets stopped upon tcsetpgrp)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/RESTEnvironment.pm