From: Michael Stapelberg Date: Sun, 10 Sep 2017 17:41:49 +0000 (+0200) Subject: tests: re-seed random number generator in workers X-Git-Tag: 4.15~98^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=bed5c9e03a2c3e36e8d7e51ae24293d132a4f2c1;p=i3%2Fi3 tests: re-seed random number generator in workers --- diff --git a/testcases/lib/TestWorker.pm b/testcases/lib/TestWorker.pm index aee994f7..c56767c4 100644 --- a/testcases/lib/TestWorker.pm +++ b/testcases/lib/TestWorker.pm @@ -99,6 +99,11 @@ sub worker_wait { $0 = $file; + # Re-seed rand() so that File::Temp’s tempnam produces different + # results, making a TOCTOU between e.g. t/175-startup-notification.t + # and t/180-fd-leaks.t less likely. + srand(time ^ $$); + POSIX::dup2($ipc_fd, 0); POSIX::dup2($ipc_fd, 1); POSIX::dup2(1, 2);