[Fusionforge-commits] r15525 - branches/Branch_5_1/src/deb-specific

Thorsten Glaser mirabilos at fusionforge.org
Mon May 14 12:04:32 CEST 2012


Author: mirabilos
Date: 2012-05-14 12:04:32 +0200 (Mon, 14 May 2012)
New Revision: 15525

Modified:
   branches/Branch_5_1/src/deb-specific/install-db.sh
Log:
prevent tempfile leak on each install/upgrade

Modified: branches/Branch_5_1/src/deb-specific/install-db.sh
===================================================================
--- branches/Branch_5_1/src/deb-specific/install-db.sh	2012-05-14 10:03:43 UTC (rev 15524)
+++ branches/Branch_5_1/src/deb-specific/install-db.sh	2012-05-14 10:04:32 UTC (rev 15525)
@@ -204,9 +204,9 @@
 	fi
 	
         # Create the appropriate database
-	tmp1=$(mktemp /tmp/$pattern)
-	tmp2=$(mktemp /tmp/$pattern)
 	if ! exist_db $db_name ; then
+		tmp1=$(mktemp /tmp/$pattern)
+		tmp2=$(mktemp /tmp/$pattern)
 		if su -s /bin/sh postgres -c "/usr/bin/psql template1" 1> $tmp1 2> $tmp2 <<EOF \
 	    	    && [ "$(tail -n +2 $tmp1 | head -1)" = 'CREATE DATABASE' ] ; 
 SET LC_MESSAGES = 'C' ;




More information about the Fusionforge-commits mailing list