summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2017-02-05 13:23:22 +0100
committerPádraig Brady <P@draigBrady.com>2017-02-09 22:15:43 -0800
commit2f69dba5df8caaf9eda658c1808b1379e9949f22 (patch)
tree06b6591378063be7c68882eb1cac0698eb25b20b /build-aux
parent99deaff7e804298cecc326142bbe7263e2576224 (diff)
downloadcoreutils-2f69dba5df8caaf9eda658c1808b1379e9949f22.tar.xz
timeout: fix race possibly terminating wrong process
The race is unlikely, as timeout(1) needs to receive a signal in the few operations between waitpid() returning and exit(). Also the system needs to have reallocated the just released pid in this time window. Previously we never disabled the signal handler that sent the termination signal to the "child" pid. However once waitpid() has reaped the child, the system is free to allocate that pid, so we must ensure we don't process any further signals. * build-aux/gen-lists-of-programs.sh: Build timeout(1) optionally... * configure.ac: ...predicated on sigsuspend() being available. * src/timeout.c (block_cleanup): A new function to ensure the cleanup() handler is disabled after waitpid has returned. (main): Use sigsuspend() to wait with cleanup() enabled but disabled once it returns, and thus disabled for the waitpid() call. (monitored_pid): Change to the more accurate pid_t. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/25624
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/gen-lists-of-programs.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/build-aux/gen-lists-of-programs.sh b/build-aux/gen-lists-of-programs.sh
index 2666492e8..cdbcd0a9e 100755
--- a/build-aux/gen-lists-of-programs.sh
+++ b/build-aux/gen-lists-of-programs.sh
@@ -32,6 +32,7 @@ build_if_possible_progs='
pinky
stdbuf
stty
+ timeout
uptime
users
who
@@ -120,7 +121,6 @@ normal_progs='
tail
tee
test
- timeout
touch
tr
true