From d952d997b10a13172b2ccc828172fa0e0358d518 Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Wed, 10 May 2006 12:43:02 +0000 Subject: [PATCH] don't rely on PID when creating a tmpdir (#158996) --- nmap-4.03-mktemp.patch | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 nmap-4.03-mktemp.patch diff --git a/nmap-4.03-mktemp.patch b/nmap-4.03-mktemp.patch new file mode 100644 index 0000000..68baffe --- /dev/null +++ b/nmap-4.03-mktemp.patch @@ -0,0 +1,23 @@ +--- nmap-4.03/shtool.mktemp 2006-05-10 13:09:34.000000000 +0200 ++++ nmap-4.03/shtool 2006-05-10 13:13:58.000000000 +0200 +@@ -579,15 +579,11 @@ + else + tmpdir="/tmp" + fi +- tmpdir="$tmpdir/.shtool.$$" +- ( umask 077 +- rm -rf "$tmpdir" >/dev/null 2>&1 || true +- mkdir "$tmpdir" >/dev/null 2>&1 +- if [ $? -ne 0 ]; then +- echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2 +- exit 1 +- fi +- ) ++ tmpdir=`mktemp -p $tmpdir -d` ++ if [ $? -ne 0 ]; then ++ echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2 ++ exit 1 ++ fi + + # create (implicitly) secure temporary file + tmpfile="$tmpdir/shtool.tmp"