diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2018-10-03 00:42:38 -0700 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-10-21 19:18:29 +1000 |
commit | 9886566abb375043740167ce5066f1a186c71176 (patch) | |
tree | 2602d3412873b77e6facc3f69c5beffed9891820 /test | |
parent | 2c91d08e62dd13979192df4a0b2ca76bde87cfd0 (diff) | |
download | pacman-9886566abb375043740167ce5066f1a186c71176.tar.xz |
reset signal handlers before running scripts/hooks
Front-ends or libraries may set signals to be ignored, which gets
inherited across fork and exec. This can cause scripts to malfunction
if they expect the signal. To make matters worse, scripts written in
bash can't reset signals that were ignored when bash was started.
Fixes FS#56756
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/pacman/tests/TESTS | 1 | ||||
-rw-r--r-- | test/pacman/tests/scriptlet-signal-reset.py | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/pacman/tests/TESTS b/test/pacman/tests/TESTS index b11cb511..5deb93c4 100644 --- a/test/pacman/tests/TESTS +++ b/test/pacman/tests/TESTS @@ -150,6 +150,7 @@ TESTS += test/pacman/tests/replace102.py TESTS += test/pacman/tests/replace103.py TESTS += test/pacman/tests/replace104.py TESTS += test/pacman/tests/replace110.py +TESTS += test/pacman/tests/scriptlet-signal-reset.py TESTS += test/pacman/tests/scriptlet001.py TESTS += test/pacman/tests/scriptlet002.py TESTS += test/pacman/tests/sign001.py diff --git a/test/pacman/tests/scriptlet-signal-reset.py b/test/pacman/tests/scriptlet-signal-reset.py new file mode 100644 index 00000000..27246d12 --- /dev/null +++ b/test/pacman/tests/scriptlet-signal-reset.py @@ -0,0 +1,11 @@ +self.description = "Reset signals before running scriptlets/hooks" + +p1 = pmpkg("dummy") +# check if SIGPIPE is ignored, it should be fatal, but GPGME ignores it +p1.install['post_install'] = "kill -PIPE $$; echo fail > sigpipe_was_ignored" +self.addpkg(p1) + +self.args = "-U %s" % p1.filename() + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!FILE_EXIST=sigpipe_was_ignored") |