aboutgitcodebugslistschat
path: root/pasta.c
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2023-02-08 16:54:40 +0100
committerStefano Brivio <sbrivio@redhat.com>2023-02-12 23:42:43 +0100
commit04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515 (patch)
tree55b214f9561f241b04d695b3789a039d0a03d245 /pasta.c
parent3487b5fc938f2f28653bec5ab8c412f5c135d300 (diff)
downloadpasst-04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515.tar
passt-04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515.tar.gz
passt-04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515.tar.bz2
passt-04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515.tar.lz
passt-04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515.tar.xz
passt-04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515.tar.zst
passt-04dfc5b81fd8d59a8ac6d27f23a7fb530a1eb515.zip
pasta: correctly exit when execvp() fails
By default clone() will create a child that does not send SIGCHLD when the child exits. The caller has to specifiy the SIGNAL it should get in the flag bitmask. see clone(2) under "The child termination signal" This fixes the problem where pasta would not exit when the execvp() call failed, i.e. when the command does not exists. Signed-off-by: Paul Holzinger <pholzing@redhat.com> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'pasta.c')
-rw-r--r--pasta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pasta.c b/pasta.c
index 9169913..d5f90e8 100644
--- a/pasta.c
+++ b/pasta.c
@@ -241,7 +241,7 @@ void pasta_start_ns(struct ctx *c, uid_t uid, gid_t gid,
pasta_child_pid = do_clone(pasta_spawn_cmd, ns_fn_stack,
sizeof(ns_fn_stack),
CLONE_NEWIPC | CLONE_NEWPID | CLONE_NEWNET |
- CLONE_NEWUTS,
+ CLONE_NEWUTS | SIGCHLD,
(void *)&arg);
if (pasta_child_pid == -1) {