6cc341
diff -up netpbm-10.35.48/converter/other/anytopnm.security2 netpbm-10.35.48/converter/other/anytopnm
6cc341
--- netpbm-10.35.48/converter/other/anytopnm.security2	2008-08-03 22:07:04.000000000 +0200
6cc341
+++ netpbm-10.35.48/converter/other/anytopnm	2008-08-04 07:11:46.000000000 +0200
6cc341
@@ -506,11 +506,7 @@ else
21b205
     inputFile="-"
21b205
 fi
cvsdist 686ba4
 
21b205
-tempdir="${TMPDIR-/tmp}/anytopnm.$$"
cvsdist 686ba4
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
cvsdist 686ba4
-chmod 700 $tempdir
cvsdist 686ba4
-
31e306
-trap 'rm -rf $tempdir' 0
21b205
+tempdir=$(mktemp -d -t anytopnm.XXXXXXXXXX) || exit 1
cvsdist 686ba4
 
6cc341
 # Take out all spaces
6cc341
 # Find the filename extension for last-ditch efforts later
6cc341
@@ -536,9 +532,17 @@ if [ "$filetype" = "unknown" ]; then
21b205
     echo "$progname: unknown file type.  " \
21b205
         "'file' says mime type is '$mimeType', " 1>&2
21b205
     echo "type description is '$typeDescription'" 1>&2
21b205
+    if [ -d "$tempdir" ] ; then
21b205
+        rm -rf "$tempdir"
cvsdist 686ba4
+    fi
21b205
+
cvsdist 686ba4
     exit 1
21b205
     fi
cvsdist 686ba4
 
21b205
 convertIt $file $filetype
cvsdist 686ba4
 
21b205
+if [ -d "$tempdir" ] ; then
21b205
+    rm -rf "$tempdir"
cvsdist 686ba4
+fi
21b205
+
21b205
 exit 0
6cc341
diff -up netpbm-10.35.48/editor/pamstretch-gen.security2 netpbm-10.35.48/editor/pamstretch-gen
6cc341
--- netpbm-10.35.48/editor/pamstretch-gen.security2	2008-08-03 22:06:45.000000000 +0200
6cc341
+++ netpbm-10.35.48/editor/pamstretch-gen	2008-08-04 07:11:46.000000000 +0200
6cc341
@@ -31,10 +31,7 @@ if [ "$1" = "" ]; then
6cc341
   exit 1
6cc341
 fi
6cc341
 
6cc341
-tempdir="${TMPDIR-/tmp}/pamstretch-gen.$$"
6cc341
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
6cc341
-chmod 700 $tempdir
6cc341
-tempfile=$tempdir/pnmig
6cc341
+tempfile=$(mktemp /tmp/pnmig.XXXXXXXXXX) || exit 1
6cc341
 
6cc341
 trap 'rm -rf $tempdir' 0 1 3 15
6cc341
 
6cc341
diff -up netpbm-10.35.48/editor/pnmmargin.security2 netpbm-10.35.48/editor/pnmmargin
6cc341
--- netpbm-10.35.48/editor/pnmmargin.security2	2008-08-03 22:06:45.000000000 +0200
6cc341
+++ netpbm-10.35.48/editor/pnmmargin	2008-08-04 07:11:46.000000000 +0200
6cc341
@@ -11,16 +11,11 @@
6cc341
 # documentation.  This software is provided "as is" without express or
6cc341
 # implied warranty.
6cc341
 
6cc341
-tempdir="${TMPDIR-/tmp}/pnmmargin.$$"
6cc341
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
6cc341
-chmod 700 $tempdir
6cc341
-
6cc341
-trap 'rm -rf $tempdir' 0 1 3 15
6cc341
-
6cc341
-tmp1=$tempdir/pnmm1
6cc341
-tmp2=$tempdir/pnmm2
6cc341
-tmp3=$tempdir/pnmm3
6cc341
-tmp4=$tempdir/pnmm4
6cc341
+tmpdir=$(mktemp -d -t ppmmargin.XXXXXXX) || exit 1
6cc341
+tmp1="$tmpdir/tmp1"
6cc341
+tmp2="$tmpdir/tmp2"
6cc341
+tmp3="$tmpdir/tmp3"
6cc341
+tmp4="$tmpdir/tmp4"
6cc341
 
6cc341
 color="-gofigure"
6cc341
 
6cc341
@@ -39,6 +34,9 @@ while true ; do
6cc341
 	shift
6cc341
 	if [ ! ${1-""} ] ; then
6cc341
 	    echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
6cc341
+            if [ -d "$tmpdir" ]; then
6cc341
+                rm -rf "$tmpdir"
6cc341
+            fi
6cc341
 	    exit 1
6cc341
 	fi
6cc341
 	color="$1"
6cc341
@@ -46,6 +44,9 @@ while true ; do
6cc341
 	;;
6cc341
 	-* )
6cc341
 	echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
6cc341
+        if [ -d "$tmpdir" ]; then
6cc341
+            rm -rf "$tmpdir"
6cc341
+        fi
6cc341
 	exit 1
6cc341
 	;;
6cc341
 	* )
6cc341
@@ -56,6 +57,9 @@ done
6cc341
 
6cc341
 if [ ! ${1-""} ] ; then
6cc341
     echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
6cc341
+    if [ -d "$tmpdir" ]; then
6cc341
+        rm -rf "$tmpdir"
6cc341
+    fi
6cc341
     exit 1
6cc341
 fi
6cc341
 size="$1"
6cc341
@@ -63,6 +67,9 @@ shift
6cc341
 
6cc341
 if [ ${2-""} ] ; then
6cc341
     echo "usage: $0 [-white|-black|-color <colorspec>] <size> [pnmfile]" 1>&2
6cc341
+    if [ -d "$tmpdir" ]; then
6cc341
+        rm -rf "$tmpdir"
6cc341
+    fi
6cc341
     exit 1
6cc341
 fi
6cc341
 
6cc341
@@ -86,3 +93,7 @@ pamflip -rotate90 $tmp2 > $tmp3
6cc341
 # Cat things together.
6cc341
 pnmcat -lr $tmp2 $tmp1 $tmp2 > $tmp4
6cc341
 pnmcat -tb $tmp3 $tmp4 $tmp3
6cc341
+
6cc341
+if [ -d "$tmpdir" ]; then
6cc341
+    rm -rf "$tmpdir"
6cc341
+fi
6cc341
diff -up netpbm-10.35.48/editor/ppmfade.security2 netpbm-10.35.48/editor/ppmfade
6cc341
--- netpbm-10.35.48/editor/ppmfade.security2	2008-08-03 22:06:45.000000000 +0200
6cc341
+++ netpbm-10.35.48/editor/ppmfade	2008-08-04 07:11:46.000000000 +0200
cvsdist 686ba4
@@ -14,6 +14,7 @@
cvsdist 686ba4
 #
cvsdist 686ba4
 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
cvsdist 686ba4
 use strict;
cvsdist 686ba4
+use File::Temp "tempdir";
cvsdist 686ba4
 
cvsdist 686ba4
 my $SPREAD =  1;
cvsdist 686ba4
 my $SHIFT =   2;
21b205
@@ -116,20 +117,26 @@ if ($first_file ne "undefined") {
cvsdist 686ba4
 
cvsdist 686ba4
 print("Frames are " . $width . "W x " . $height . "H\n");
cvsdist 686ba4
 
cvsdist 686ba4
+#
cvsdist 686ba4
+# We create a tmp-directory right here
cvsdist 686ba4
+#
cvsdist 686ba4
+my $tmpdir = tempdir("ppmfade.XXXXXX", CLEANUP => 1);
cvsdist 686ba4
+
cvsdist 686ba4
+
cvsdist 686ba4
 if ($first_file eq "undefined") {
cvsdist 686ba4
     print "Fading from black to ";
cvsdist 686ba4
-    system("ppmmake \\#000 $width $height >junk1$$.ppm");
cvsdist 686ba4
+    system("ppmmake \\#000 $width $height >$tmpdir/junk1$$.ppm");
cvsdist 686ba4
 } else {
cvsdist 686ba4
     print "Fading from $first_file to ";
cvsdist 686ba4
-    system("cp", $first_file, "junk1$$.ppm");
cvsdist 686ba4
+    system("cp", $first_file, "$tmpdir/junk1$$.ppm");
cvsdist 686ba4
 }
cvsdist 686ba4
 
cvsdist 686ba4
 if ($last_file eq "undefined") {
cvsdist 686ba4
     print "black.\n";
cvsdist 686ba4
-    system("ppmmake \\#000 $width $height >junk2$$.ppm");
cvsdist 686ba4
+    system("ppmmake \\#000 $width $height >$tmpdir/junk2$$.ppm");
cvsdist 686ba4
 } else {
cvsdist 686ba4
     print "$last_file\n";
cvsdist 686ba4
-    system("cp", $last_file, "junk2$$.ppm");
cvsdist 686ba4
+    system("cp", $last_file, "$tmpdir/junk2$$.ppm");
cvsdist 686ba4
 }
cvsdist 686ba4
 
cvsdist 686ba4
 #
21b205
@@ -137,14 +144,14 @@ if ($last_file eq "undefined") {
21b205
 #
21b205
 
21b205
 # Here's what our temporary files are:
21b205
-#   junk1$$.ppm: The original (fade-from) image
21b205
-#   junk2$$.ppm: The target (fade-from) image
21b205
-#   junk3$$.ppm: The frame of the fade for the current iteration of the 
21b205
-#                the for loop.
21b205
-#   junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
21b205
-#                 image to another, this is the first frame of that 
21b205
-#                 sequence.
21b205
-#   junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
21b205
+#   $tmpdir/junk1$$.ppm: The original (fade-from) image
21b205
+#   $tmpdir/junk2$$.ppm: The target (fade-from) image
21b205
+#   $tmpdir/junk3$$.ppm: The frame of the fade for the current iteration of the 
21b205
+#                	 the for loop.
21b205
+#   $tmpdir/junk1a$$.ppm: If the fade involves a ppmmix sequence from one intermediate
21b205
+#                         image to another, this is the first frame of that 
21b205
+#                         sequence.
21b205
+#   $tmpdir/junk2a$$.ppm: This is the last frame of the above-mentioned ppmmix sequence
21b205
 
21b205
 my $i;    # Frame number
21b205
 for ($i = 1; $i <= $nframes; $i++) {
21b205
@@ -152,148 +159,148 @@ for ($i = 1; $i <= $nframes; $i++) {
cvsdist 686ba4
     if ($mode eq $SPREAD) {
cvsdist 686ba4
         if ($i <= 10) {
cvsdist 686ba4
             my $n = $spline20[$i] * 100;
cvsdist 686ba4
-            system("ppmspread $n junk1$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } elsif ($i <= 20) {
cvsdist 686ba4
             my $n;
cvsdist 686ba4
             $n = $spline20[$i] * 100;
cvsdist 686ba4
-            system("ppmspread $n junk1$$.ppm >junk1a$$.ppm");
cvsdist 686ba4
+            system("ppmspread $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
cvsdist 686ba4
             $n = (1-$spline20[$i-10]) * 100;
cvsdist 686ba4
-            system("ppmspread $n junk2$$.ppm >junk2a$$.ppm");
cvsdist 686ba4
+            system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
cvsdist 686ba4
             $n = $spline10[$i-10];
cvsdist 686ba4
-            system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } else {
cvsdist 686ba4
             my $n = (1-$spline20[$i-10])*100;
cvsdist 686ba4
-            system("ppmspread $n junk2$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmspread $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
     } elsif ($mode eq $SHIFT) {
cvsdist 686ba4
         if ($i <= 10) {
cvsdist 686ba4
             my $n = $spline20[$i] * 100;
cvsdist 686ba4
-            system("ppmshift $n junk1$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } elsif ($i <= 20) {
cvsdist 686ba4
             my $n;
cvsdist 686ba4
             $n = $spline20[$i] * 100;
cvsdist 686ba4
-            system("ppmshift $n junk1$$.ppm >junk1a$$.ppm");
cvsdist 686ba4
+            system("ppmshift $n $tmpdir/junk1$$.ppm >$tmpdir/junk1a$$.ppm");
cvsdist 686ba4
             $n = (1-$spline20[$i-10])*100;
cvsdist 686ba4
-            system("ppmshift $n junk2$$.ppm >junk2a$$.ppm");
cvsdist 686ba4
+            system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk2a$$.ppm");
cvsdist 686ba4
             $n = $spline10[$i-10];
cvsdist 686ba4
-            system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } else {
cvsdist 686ba4
             my $n = (1-$spline20[$i-10]) * 100;
cvsdist 686ba4
-            system("ppmshift $n junk2$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmshift $n $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
     } elsif ($mode eq $RELIEF) {
cvsdist 686ba4
         if ($i == 1) {
cvsdist 686ba4
-            system("ppmrelief junk1$$.ppm >junk1r$$.ppm");
cvsdist 686ba4
+            system("ppmrelief $tmpdir/junk1$$.ppm >$tmpdir/junk1r$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i <= 10) {
cvsdist 686ba4
             my $n = $spline10[$i];
cvsdist 686ba4
-            system("ppmmix $n junk1$$.ppm junk1r$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1r$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } elsif ($i <= 20) {
cvsdist 686ba4
             my $n = $spline10[$i-10];
cvsdist 686ba4
-            system("ppmmix $n junk1r$$.ppm junk2r$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1r$$.ppm $tmpdir/junk2r$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } else {
cvsdist 686ba4
             my $n = $spline10[$i-20];
cvsdist 686ba4
-            system("ppmmix $n junk2r$$.ppm junk2$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk2r$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i == 10) {
cvsdist 686ba4
-            system("ppmrelief junk2$$.ppm >junk2r$$.ppm");
cvsdist 686ba4
+            system("ppmrelief $tmpdir/junk2$$.ppm >$tmpdir/junk2r$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
     } elsif ($mode eq $OIL) {
cvsdist 686ba4
         if ($i == 1) {
cvsdist 686ba4
-            system("ppmtopgm junk1$$.ppm | pgmoil >junko$$.ppm");
cvsdist 686ba4
-            system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
cvsdist 686ba4
-                   ">junk1o$$.ppm");
cvsdist 686ba4
+            system("ppmtopgm $tmpdir/junk1$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
cvsdist 686ba4
+            system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
cvsdist 686ba4
+                   ">$tmpdir/junk1o$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i <= 10) {
cvsdist 686ba4
             my $n = $spline10[$i];
cvsdist 686ba4
-            system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } elsif ($i <= 20) {
cvsdist 686ba4
             my $n = $spline10[$i-10];
cvsdist 686ba4
-            system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } else {
cvsdist 686ba4
             my $n = $spline10[$i-20];
cvsdist 686ba4
-            system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i == 10) {
cvsdist 686ba4
-            system("ppmtopgm junk2$$.ppm | pgmoil >junko$$.ppm");
cvsdist 686ba4
-            system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
cvsdist 686ba4
-                   ">junk2o$$.ppm");
cvsdist 686ba4
+            system("ppmtopgm $tmpdir/junk2$$.ppm | pgmoil >$tmpdir/junko$$.ppm");
cvsdist 686ba4
+            system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
cvsdist 686ba4
+                   ">$tmpdir/junk2o$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
     } elsif ($mode eq $EDGE) {
cvsdist 686ba4
         if ($i == 1) {
cvsdist 686ba4
-            system("ppmtopgm junk1$$.ppm | pgmedge >junko$$.ppm");
cvsdist 686ba4
-            system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
cvsdist 686ba4
-                   ">junk1o$$.ppm");
cvsdist 686ba4
+            system("ppmtopgm $tmpdir/junk1$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
cvsdist 686ba4
+            system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
cvsdist 686ba4
+                   ">$tmpdir/junk1o$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i <= 10) {
cvsdist 686ba4
             my $n = $spline10[$i];
cvsdist 686ba4
-            system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } elsif ($i <= 20) {
cvsdist 686ba4
             my $n = $spline10[$i-10];
cvsdist 686ba4
-            system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } else {
cvsdist 686ba4
             my $n = $spline10[$i-20];
cvsdist 686ba4
-            system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i == 10) {
cvsdist 686ba4
-            system("ppmtopgm junk2$$.ppm | pgmedge >junko$$.ppm");
cvsdist 686ba4
-            system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
cvsdist 686ba4
-                   ">junk2o$$.ppm");
cvsdist 686ba4
+            system("ppmtopgm $tmpdir/junk2$$.ppm | pgmedge >$tmpdir/junko$$.ppm");
cvsdist 686ba4
+            system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
cvsdist 686ba4
+                   ">$tmpdir/junk2o$$.ppm");
cvsdist 686ba4
         } 
cvsdist 686ba4
     } elsif ($mode eq $BENTLEY) {
cvsdist 686ba4
         if ($i == 1) {
cvsdist 686ba4
-            system("ppmtopgm junk1$$.ppm | pgmbentley >junko$$.ppm");
cvsdist 686ba4
-            system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
cvsdist 686ba4
-                   ">junk1o$$.ppm");
cvsdist 686ba4
+            system("ppmtopgm $tmpdir/junk1$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
cvsdist 686ba4
+            system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
cvsdist 686ba4
+                   ">$tmpdir/junk1o$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i <= 10) {
cvsdist 686ba4
             my $n = $spline10[$i];
cvsdist 686ba4
-            system("ppmmix $n junk1$$.ppm junk1o$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1$$.ppm $tmpdir/junk1o$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } elsif ($i <= 20) {
cvsdist 686ba4
             my $n = $spline10[$i-10];
cvsdist 686ba4
-            system("ppmmix $n junk1o$$.ppm junk2o$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1o$$.ppm $tmpdir/junk2o$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } else {
cvsdist 686ba4
             my $n = $spline10[$i-20];
cvsdist 686ba4
-            system("ppmmix $n junk2o$$.ppm junk2$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk2o$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i == 10) {
cvsdist 686ba4
-            system("ppmtopgm junk2$$.ppm | pgmbentley >junko$$.ppm");
cvsdist 686ba4
-            system("rgb3toppm junko$$.ppm junko$$.ppm junko$$.ppm " .
cvsdist 686ba4
-                   ">junk2o$$.ppm");
cvsdist 686ba4
+            system("ppmtopgm $tmpdir/junk2$$.ppm | pgmbentley >$tmpdir/junko$$.ppm");
21b205
+            system("rgb3toppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm $tmpdir/junko$$.ppm " .
cvsdist 686ba4
+                   ">$tmpdir/junk2o$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
     } elsif ($mode eq $BLOCK) {
cvsdist 686ba4
         if ($i <= 10) {
cvsdist 686ba4
             my $n = 1 - 1.9*$spline20[$i];
21b205
-            system("pamscale $n junk1$$.ppm | " .
21b205
-                   "pamscale -width $width -height $height >junk3$$.ppm");
21b205
+            system("pamscale $n $tmpdir/junk1$$.ppm | " .
21b205
+                   "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } elsif ($i <= 20) {
cvsdist 686ba4
             my $n = $spline10[$i-10];
cvsdist 686ba4
-            system("ppmmix $n junk1a$$.ppm junk2a$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+            system("ppmmix $n $tmpdir/junk1a$$.ppm $tmpdir/junk2a$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         } else {
cvsdist 686ba4
             my $n = 1 - 1.9*$spline20[31-$i];
21b205
-            system("pamscale $n junk2$$.ppm | " .
21b205
-                   "pamscale -width $width -height $height >junk3$$.ppm");
21b205
+            system("pamscale $n $tmpdir/junk2$$.ppm | " .
21b205
+                   "pamscale -width $width -height $height >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
         }
cvsdist 686ba4
         if ($i == 10) {
cvsdist 686ba4
-            system("cp", "junk3$$.ppm", "junk1a$$.ppm");
21b205
-            system("pamscale $n junk2$$.ppm | " .
21b205
-                   "pamscale -width $width -height $height >junk2a$$.ppm");
cvsdist 686ba4
+            system("cp", "$tmpdir/junk3$$.ppm", "$tmpdir/junk1a$$.ppm");
21b205
+            system("pamscale $n $tmpdir/junk2$$.ppm | " .
21b205
+                   "pamscale -width $width -height $height >$tmpdir/junk2a$$.ppm");
cvsdist 686ba4
         }    
cvsdist 686ba4
     } elsif ($mode eq $MIX) {
cvsdist 686ba4
         my $fade_factor = sqrt(1/($nframes-$i+1));
cvsdist 686ba4
-        system("ppmmix $fade_factor junk1$$.ppm junk2$$.ppm >junk3$$.ppm");
cvsdist 686ba4
+        system("ppmmix $fade_factor $tmpdir/junk1$$.ppm $tmpdir/junk2$$.ppm >$tmpdir/junk3$$.ppm");
cvsdist 686ba4
     } else {
cvsdist 686ba4
         print("Internal error: impossible mode value '$mode'\n");
cvsdist 686ba4
     }
cvsdist 686ba4
 
cvsdist 686ba4
     my $outfile = sprintf("%s.%04d.ppm", $base_name, $i);
cvsdist 686ba4
-    system("cp", "junk3$$.ppm", $outfile);
cvsdist 686ba4
+    system("cp", "$tmpdir/junk3$$.ppm", $outfile);
cvsdist 686ba4
 }
cvsdist 686ba4
 
cvsdist 686ba4
 #
cvsdist 686ba4
 #  Clean up shop.
cvsdist 686ba4
 #
cvsdist 686ba4
-system("rm junk*$$.ppm");
21b205
+system("rm $tmpdir/junk*$$.ppm");
cvsdist 686ba4
 
cvsdist 686ba4
 exit(0);
cvsdist 686ba4
 
6cc341
diff -up netpbm-10.35.48/editor/ppmquantall.security2 netpbm-10.35.48/editor/ppmquantall
6cc341
--- netpbm-10.35.48/editor/ppmquantall.security2	2008-08-03 22:06:45.000000000 +0200
6cc341
+++ netpbm-10.35.48/editor/ppmquantall	2008-08-04 07:11:46.000000000 +0200
6cc341
@@ -70,13 +70,8 @@ for i in ${files[@]}; do
21b205
     heights=(${heights[*]} `grep -v '^#' $i | sed '1d; s/.* //; 2q'`)
21b205
 done
cvsdist 686ba4
 
21b205
-tempdir="${TMPDIR-/tmp}/ppmquantall.$$"
21b205
-mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;}
21b205
-chmod 700 $tempdir
21b205
-
21b205
-trap 'rm -rf $tempdir' 0 1 3 15
21b205
-
21b205
-all=$tempdir/pqa.all.$$
21b205
+all=$(mktemp -t pqa.all.XXXXXXXXXX) || exit 1
21b205
+rm -f $all
cvsdist 686ba4
 
21b205
 pnmcat -topbottom -jleft -white ${files[@]} | pnmquant $newcolors > $all
21b205
 if [ $? != 0 ]; then
6cc341
diff -up netpbm-10.35.48/editor/ppmshadow.security2 netpbm-10.35.48/editor/ppmshadow
6cc341
--- netpbm-10.35.48/editor/ppmshadow.security2	2008-08-03 22:06:45.000000000 +0200
6cc341
+++ netpbm-10.35.48/editor/ppmshadow	2008-08-04 07:11:46.000000000 +0200
31e306
@@ -72,9 +72,10 @@ sub makeConvolutionKernel($$) {
31e306
 
21b205
 
21b205
 my $tmpdir = $ENV{TMPDIR} || "/tmp";
21b205
-my $ourtmp = "$tmpdir/ppmshadow$$";
31e306
-mkdir($ourtmp, 0777) or
21b205
-    die("Unable to create directory for temporary files '$ourtmp");
6ae131
+my $ourtmp; chomp($ourtmp = `mktemp -d -t PPMshadow.XXXXXX`);
21b205
+if ($? >> 8) {
31e306
+    die "Can't create directory for temporary files";
21b205
+}
21b205
 
21b205
 #   Process command line options
cvsdist 686ba4