[Fusionforge-commits] r9235 - branches/Branch_5_0/gforge/common/frs

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Wed Mar 24 21:03:44 CET 2010


Author: aljeux
Date: 2010-03-24 21:03:44 +0100 (Wed, 24 Mar 2010)
New Revision: 9235

Modified:
   branches/Branch_5_0/gforge/common/frs/FRSPackage.class.php
Log:
Use PHP mkdir instead of exec mkdir (safer)

Modified: branches/Branch_5_0/gforge/common/frs/FRSPackage.class.php
===================================================================
--- branches/Branch_5_0/gforge/common/frs/FRSPackage.class.php	2010-03-24 20:03:35 UTC (rev 9234)
+++ branches/Branch_5_0/gforge/common/frs/FRSPackage.class.php	2010-03-24 20:03:44 UTC (rev 9235)
@@ -177,8 +177,11 @@
 				@mkdir($groupdir);
 			}
 
-			$newdirlocation = $GLOBALS['sys_upload_dir'].'/'.$this->Group->getUnixName().'/'.$this->getFileName();
-			exec("/bin/mkdir $newdirlocation",$out);
+			$newdirlocation = $groupdir.'/'.$this->getFileName();
+			if (!is_dir($newdirlocation)) {
+				@mkdir($newdirlocation);
+			}
+			
 			// this 2 should normally silently fail (because it's called with the apache user) but if it's root calling the create() method, then the owner and group for the directory should be changed
 			@chown($newdirlocation,$sys_apache_user);
 			@chgrp($newdirlocation,$sys_apache_group);




More information about the Fusionforge-commits mailing list