File gnash-fix-insecure-temp-files.diff of Package gnash.import5931

From 6d86dd8cb9d567d8a6cedac301850c7349fe0ced Mon Sep 17 00:00:00 2001
From: Gabriele Giacone <1o5g4r8o@gmail.com>
Date: Mon, 3 Jan 2011 17:55:51 +0100
Subject: [PATCH] Create configure temporary files in a secure way

---
 configure.ac |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

--- a/configure.ac
+++ b/configure.ac
@@ -2923,9 +2923,14 @@
 ########################## Final report begins... ############################
 ###
 
-cerr=/tmp/gnash-configure-errors.$$
-cwarn=/tmp/gnash-configure-warnings.$$
-crec=/tmp/gnash-configure-recommended.$$
+dnl Create temporary directory in a secure way
+tmp=`mktemp -d ${TMPDIR=/tmp}/gnash-configure-XXXXXX`
+if test \! -n "$tmp" || test \! -d "$tmp"; then
+  tmp=`(umask 077 && mkdir -d ${TMPDIR=/tmp}/gnash-configure-${RANDOM}-$$) 2>/dev/null`
+fi
+cerr=${tmp}/errors
+cwarn=${tmp}/warnings
+crec=${tmp}/recommended
 echo ""
 
 #trap 'rm cerr' 0 # trap isn't a good idea, might override other traps
@@ -3194,6 +3199,7 @@
   fi
 fi
 
+rmdir $tmp
 
 if test x$build_hildon = xyes; then #{
   if test x"$HILDON_LIBS" != x; then
openSUSE Build Service is sponsored by