Skip to content

Commit 80075f3

Browse files
committed
Reset SIGCHLD action to SIG_DFL
Signed-off-by: Joel Pelaez Jorge <joel.pelaez.jorge@gmail.com>
1 parent d0d934e commit 80075f3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

bubblewrap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2889,6 +2889,7 @@ main (int argc,
28892889
int intermediate_pids_sockets[2] = {-1, -1};
28902890
const char *exec_path = NULL;
28912891
int i;
2892+
struct sigaction sa = {};
28922893

28932894
/* Handle --version early on before we try to acquire/drop
28942895
* any capabilities so it works in a build environment;
@@ -2898,6 +2899,12 @@ main (int argc,
28982899
if (argc == 2 && (strcmp (argv[1], "--version") == 0))
28992900
print_version_and_exit ();
29002901

2902+
/* Reset SIGCHILD to SIG_DFL allowing signalfd working propertly
2903+
* if the parent process had set SIGCHLD to SIG_IGN. */
2904+
sigemptyset (&sa.sa_mask);
2905+
sa.sa_handler = SIG_DFL;
2906+
sigaction (SIGCHLD, &sa, NULL);
2907+
29012908
real_uid = getuid ();
29022909
real_gid = getgid ();
29032910

0 commit comments

Comments
 (0)