pkgsrc-ng/textproc/groff/patches/patch-contrib_gdiffmk_tests_runtests.in
2013-09-26 17:14:40 +02:00

24 lines
839 B
Plaintext

$NetBSD: patch-contrib_gdiffmk_tests_runtests.in,v 1.1 2011/07/19 21:09:38 tez Exp $
Fix many temporary file handling issues, including in pdfroff
(resolves CVE-2009-5044 / SA44999)
Patches copied from:
http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/groff/groff-1.20.1-owl-tmp.diff?rev=1.2
Modified for pkgsrc and excluded a documentaion change to doc/groff.texinfo
that changes a `makeinfo' is too old warning into a fatal error.
--- contrib/gdiffmk/tests/runtests.in.orig 2009-01-09 14:25:53.000000000 +0000
+++ contrib/gdiffmk/tests/runtests.in
@@ -56,8 +56,9 @@ function TestResult {
fi
}
-tmpfile=/tmp/$$
-trap 'rm -f ${tmpfile}' 0 1 2 3 15
+tmpfile="`mktemp -t gdiffmk-runtests.XXXXXXXXXX`" || exit
+trap 'rm -f -- "$tmpfile"' EXIT
+trap 'trap - EXIT; rm -f -- "$tmpfile"; exit 1' HUP INT QUIT TERM
# Run tests.