about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-27 17:22:49 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2020-06-27 17:22:49 +0000
commit318cef2ba85b550898cd7637dc334043967841df (patch)
treee5b6422795f397a1b0fc342713642c61be0a0efd
parentbae946382facd3561a32ace3ff15ee35e31549d7 (diff)
downloadnetpbm-mirror-318cef2ba85b550898cd7637dc334043967841df.tar.gz
netpbm-mirror-318cef2ba85b550898cd7637dc334043967841df.tar.xz
netpbm-mirror-318cef2ba85b550898cd7637dc334043967841df.zip
Fix handling of mktemp failure
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3871 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rwxr-xr-xconverter/other/anytopnm2
-rwxr-xr-xconverter/ppm/hpcdtoppm/pcdovtoppm2
-rw-r--r--doc/HISTORY8
-rwxr-xr-xeditor/pnmmargin2
4 files changed, 11 insertions, 3 deletions
diff --git a/converter/other/anytopnm b/converter/other/anytopnm
index 5409bccd..94838556 100755
--- a/converter/other/anytopnm
+++ b/converter/other/anytopnm
@@ -538,7 +538,7 @@ else
 fi
 
 tempdir=$(mktemp -d "${TMPDIR:-/tmp}/anytopnm.XXXXXXXX") ||
-    ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) 
+    { echo "Could not create temporary file. Exiting." 1>&2; exit 1; }
 trap 'rm -rf $tempdir' 0
 
 # Take out all spaces
diff --git a/converter/ppm/hpcdtoppm/pcdovtoppm b/converter/ppm/hpcdtoppm/pcdovtoppm
index 715734bd..4f83f121 100755
--- a/converter/ppm/hpcdtoppm/pcdovtoppm
+++ b/converter/ppm/hpcdtoppm/pcdovtoppm
@@ -113,7 +113,7 @@ if [ $# = 0 ]; then
 fi
 
 tempdir=$(mktemp -d "${TMPDIR:-/tmp}/pcdovtoppm.XXXXXXXX") ||
-    ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) 
+    { echo "Could not create temporary file. Exiting." 1>&2; exit 1; }
 trap 'rm -rf $tempdir' 0
 
 tmpfile=`tempfile -p pi -m 600`
diff --git a/doc/HISTORY b/doc/HISTORY
index 71b5a43c..a3df22d8 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -11,6 +11,14 @@ not yet  BJH  Release 10.91.00
 
               pamstereogram: Add -tileable.  Thanks Scott Pakin.
 
+              pcdovtoppm: more secure temporary file handling.
+
+              pcdovtoppm: properly selects Bash as interpreter.  Broken in
+              Netpbm 9.9 (March 2001).
+
+              anytopnm, pnmmargin: Fail properly when unable to create
+              temporary file.  Broken in Netpbm 10.75 (June 2016).
+
               winicontoppm: Fix undefined behavior for various invalid input.
               Always broken.  Winicontoppm was new in Netpbm 9.3 (June 2000).
 
diff --git a/editor/pnmmargin b/editor/pnmmargin
index 9dbe24b7..1b5370be 100755
--- a/editor/pnmmargin
+++ b/editor/pnmmargin
@@ -12,7 +12,7 @@
 # implied warranty.
 
 tempdir=$(mktemp -d "${TMPDIR:-/tmp}/netpbm.XXXXXXXX") ||
-    ( echo "Could not create temporary file. Exiting." 1>&2; exit 1; ) 
+    { echo "Could not create temporary file. Exiting." 1>&2; exit 1; }
 trap 'rm -rf $tempdir' 0 1 3 15
 
 tmp1=$tempdir/pnmm1