diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-07-11 15:38:35 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2007-07-11 15:38:35 +0000 |
commit | 2cba33bd7cac4da8fe38aa2925bd4891ef450d54 (patch) | |
tree | 2d0cebedd3164aa23779b5a080986bd8661bc341 /editor | |
parent | ba4878cdfb3cf90db48319fe9d067eb723a8cc93 (diff) | |
download | netpbm-mirror-2cba33bd7cac4da8fe38aa2925bd4891ef450d54.tar.gz netpbm-mirror-2cba33bd7cac4da8fe38aa2925bd4891ef450d54.tar.xz netpbm-mirror-2cba33bd7cac4da8fe38aa2925bd4891ef450d54.zip |
Fix temp file security problem
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@357 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'editor')
-rwxr-xr-x | editor/pnmmargin | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/pnmmargin b/editor/pnmmargin index b4c87bb7..9950bdcb 100755 --- a/editor/pnmmargin +++ b/editor/pnmmargin @@ -11,10 +11,11 @@ # documentation. This software is provided "as is" without express or # implied warranty. +oldumask=$(umask) +umask 0077 tempdir="${TMPDIR-/tmp}/pnmmargin.$$" mkdir $tempdir || { echo "Could not create temporary file. Exiting."; exit 1;} -chmod 700 $tempdir - +umask $oldumask trap 'rm -rf $tempdir' 0 1 3 15 tmp1=$tempdir/pnmm1 |