[Fusionforge-commits] r9402 - trunk/gforge/plugins/scmgit/common

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Apr 7 16:42:33 CEST 2010


Author: lolando
Date: 2010-04-07 16:42:33 +0200 (Wed, 07 Apr 2010)
New Revision: 9402

Modified:
   trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
Log:
Fixed permissions on repositories

Modified: trunk/gforge/plugins/scmgit/common/GitPlugin.class.php
===================================================================
--- trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-07 14:42:21 UTC (rev 9401)
+++ trunk/gforge/plugins/scmgit/common/GitPlugin.class.php	2010-04-07 14:42:33 UTC (rev 9402)
@@ -237,9 +237,11 @@
 		system ("chgrp -R $unix_group $root") ;
 		system ("chmod g+s $root") ;
 		if ($project->enableAnonSCM()) {
-			system ("chmod -R g+wX,o+rX-w $root") ;
+			system ("chmod g+wX,o+rX-w $root") ;
+			system ("chmod -R g+wX,o+rX-w $main_repo") ;
 		} else {
-			system ("chmod -R g+wX,o-rwx $root") ;
+			system ("chmod g+wX,o-rwx $root") ;
+			system ("chmod -R g+wX,o-rwx $main_repo") ;
 		}
 
 		$result = db_query_params ('SELECT u.user_name FROM plugin_scmgit_personal_repos p, users u WHERE p.group_id=$1 AND u.user_id=p.user_id AND u.unix_status=$2',
@@ -254,12 +256,12 @@
 			if (!is_file ("$repodir/HEAD") && !is_dir("$repodir/objects") && !is_dir("$repodir/refs")) {
 				system ("git clone --bare $main_repo $repodir") ;
 				system ("echo \"Git repository for user $owner in project $project_name\" > $repodir/description") ;
-				system ("chown -R $user_name:$unix_group $root") ;
-				if ($project->enableAnonSCM()) {
-					system ("chmod -R g+rX-w,o+rX-w $root") ;
-				} else {
-					system ("chmod -R g+rX-w,o-rwx $root") ;
-				}
+				system ("chown -R $user_name:$unix_group $repodir") ;
+			}
+			if ($project->enableAnonSCM()) {
+				system ("chmod -R g+rX-w,o+rX-w $repodir") ;
+			} else {
+				system ("chmod -R g+rX-w,o-rwx $repodir") ;
 			}			
 		}
 	}




More information about the Fusionforge-commits mailing list