{"thread":{"id":"57665","subject":"ignored signals are not reset on execve","startedAt":"2022-04-05T09:53:37Z","lastAt":"2022-04-05T09:53:37Z","messageCount":1,"participants":["Rasmus Villemoes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"453109","messageId":"420575be-1e0d-2c3b-ca5e-f9084688dcbb@prevas.dk","threadId":"57665","inReplyTo":null,"subject":"ignored signals are not reset on execve","fromName":"Rasmus Villemoes","fromEmail":"rasmus.villemoes@prevas.dk","sentAt":"2022-04-05T09:08:00Z","receivedAt":"2022-04-05T09:53:37Z","isPatch":false,"sender":{"key":"rasmus.villemoes@prevas.dk","avatar":null},"body":"Hi,\n\nrun-command.c has\n\n\t\tfor (sig = 1; sig < NSIG; sig++) {\n\t\t\t/* ignored signals get reset to SIG_DFL on execve */\n\t\t\tif (signal(sig, SIG_DFL) == SIG_IGN)\n\t\t\t\tsignal(sig, SIG_IGN);\n\t\t}\n\nintroduced by commit 45afb1ca9c28 (run-command: block signals between\nfork and execve).\n\nHowever, 'man 7 signal' says\n\n       A child created via fork(2) inherits a copy of its parent's\nsignal dispositions.  During an execve(2),  the  dispositions  of\n       handled signals are reset to the default; the dispositions of\nignored signals are left unchanged.\n\nSo at least the comment is wrong, and the child is actually run with\nthose signals ignored. Whether that's the intent I cannot say, but I\ndoubt it; programs generally don't expect to be run with any signals\nignored.\n\nRasmus\n"}]}