62a8fc
--- nmap-4.03/shtool.mktemp	2006-05-10 13:09:34.000000000 +0200
62a8fc
+++ nmap-4.03/shtool	2006-05-10 13:13:58.000000000 +0200
62a8fc
@@ -579,15 +579,11 @@
62a8fc
     else
62a8fc
         tmpdir="/tmp"
62a8fc
     fi
62a8fc
-    tmpdir="$tmpdir/.shtool.$$"
62a8fc
-    ( umask 077
62a8fc
-      rm -rf "$tmpdir" >/dev/null 2>&1 || true
62a8fc
-      mkdir  "$tmpdir" >/dev/null 2>&1
62a8fc
-      if [ $? -ne 0 ]; then
62a8fc
-          echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2
62a8fc
-          exit 1
62a8fc
-      fi
62a8fc
-    )
62a8fc
+    tmpdir=`mktemp -p $tmpdir -d`
62a8fc
+    if [ $? -ne 0 ]; then
62a8fc
+       echo "$msgprefix:Error: failed to create temporary directory \`$tmpdir'" 1>&2
62a8fc
+       exit 1
62a8fc
+    fi
62a8fc
 
62a8fc
     #   create (implicitly) secure temporary file
62a8fc
     tmpfile="$tmpdir/shtool.tmp"