Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/dhcpcd/dist/src Don't block signals when runnin...



details:   https://anonhg.NetBSD.org/src/rev/a8086c0705cc
branches:  trunk
changeset: 1008912:a8086c0705cc
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Apr 05 15:41:45 2020 +0000

description:
Don't block signals when running hooks. Here ctx->sigset == defsigs ==
0x60006003, which blocks SIGTERM by default, so running something simple
from a hook, like /etc/rc.d/racoon restart does not work. The script
is then stuck waiting for the daemon to die, which it won't since it will
never receive the signal, and the hook never terminates.

diffstat:

 external/bsd/dhcpcd/dist/src/script.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r fc75f067e300 -r a8086c0705cc external/bsd/dhcpcd/dist/src/script.c
--- a/external/bsd/dhcpcd/dist/src/script.c     Sun Apr 05 15:25:39 2020 +0000
+++ b/external/bsd/dhcpcd/dist/src/script.c     Sun Apr 05 15:41:45 2020 +0000
@@ -108,7 +108,8 @@
        for (i = 0; i < dhcpcd_signals_len; i++)
                sigaddset(&defsigs, dhcpcd_signals[i]);
        posix_spawnattr_setsigdefault(&attr, &defsigs);
-       posix_spawnattr_setsigmask(&attr, &ctx->sigset);
+       sigemptyset(&defsigs);
+       posix_spawnattr_setsigmask(&attr, &defsigs);
 #endif
        errno = 0;
        r = posix_spawn(&pid, argv[0], NULL, &attr, argv, env);



Home | Main Index | Thread Index | Old Index