This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, 6.1 has been updated
       via  815863e1cd1154d115aada4692618d53b5f28f41 (commit)
       via  f1854e8f4566953707cd4d7de5e25a2649fa385d (commit)
       via  51d14e798a63715124517f8b9c5048c3b4afbd1a (commit)
      from  d9fa4483c51e77e5770b6f612c9eb6af647ba09b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=815863e1cd1154d115aada4692618d53b5f28f41

commit 815863e1cd1154d115aada4692618d53b5f28f41
Author: root <franck.villa...@trivialdev.com>
Date:   Thu Feb 8 20:22:40 2018 +0100

    scmhg: multirepo support. complete

diff --git a/src/plugins/scmhg/common/HgPlugin.class.php 
b/src/plugins/scmhg/common/HgPlugin.class.php
index 1155382..be2c69e 100644
--- a/src/plugins/scmhg/common/HgPlugin.class.php
+++ b/src/plugins/scmhg/common/HgPlugin.class.php
@@ -374,17 +374,10 @@ Offer DAV or SSH access.");
                for ($i = 0; $i < $rows; $i++) {
                        $repo_name = db_result($result, $i, 'repo_name');
                        $description = db_result($result, $i, 'description');
-                       $clone_url = db_result($result, $i, 'clone_url');
-                       // Clone URLs need to be validated to prevent a 
potential arbitrary command execution
-                       if (!preg_match('|^[-a-zA-Z0-9:./_]+$|', $clone_url)) {
-                               $clone_url = '';
-                       }
+                       //no support for cloning from any URL, working dir...
                        $repodir = $root.'/'.$repo_name;
                        if (!is_dir("$repodir/.hg")) {
-                               if ($clone_url != '') {
-                               } else {
-                                       system("hg init $repodir");
-                               }
+                               system("hg init $repodir");
                                $f = fopen("$repodir/.hg/hgrc", 'w');
                                $conf = "[web]\n";
                                $conf .= "baseurl = /hg/".$project_name."\n";
@@ -400,7 +393,6 @@ Offer DAV or SSH access.");
                                system("chgrp -R $unix_group_rw $repodir");
                                system("chmod -R g=rwX,o=rX $repodir");
                                system("chmod 660 $repodir/.hg/hgrc");
-                               }
                        }
                }
 

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=f1854e8f4566953707cd4d7de5e25a2649fa385d

commit f1854e8f4566953707cd4d7de5e25a2649fa385d
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Thu Feb 8 20:05:43 2018 +0100

    scmhg: multirepo, backend implementation

diff --git a/src/plugins/scmhg/common/HgPlugin.class.php 
b/src/plugins/scmhg/common/HgPlugin.class.php
index 5f3b3d8..1155382 100644
--- a/src/plugins/scmhg/common/HgPlugin.class.php
+++ b/src/plugins/scmhg/common/HgPlugin.class.php
@@ -348,7 +348,7 @@ Offer DAV or SSH access.");
                }
                if (!is_dir("$root/$project_name/.hg")) {
                        system("hg init $root/$project_name");
-                       $f = fopen("$root/$project_name/.hg/hgrc",'w');
+                       $f = fopen("$root/$project_name/.hg/hgrc", 'w');
                        $conf = "[web]\n";
                        $conf .= "baseurl = /hg/".$project_name."\n";
                        $conf .= "description = ".$project_name."\n";
@@ -360,8 +360,6 @@ Offer DAV or SSH access.");
                        }
                        fwrite($f, $conf);
                        fclose($f);
-                       //system("chmod 770 $root");
-                       //system("find $root -type d | xargs chmod g+s");
                        system("chgrp -R $unix_group_rw $root/$project_name");
                        system("chmod -R g=rwX,o=rX $root/$project_name");
                        system("chmod 660 $root/$project_name/.hg/hgrc");
@@ -373,7 +371,7 @@ Offer DAV or SSH access.");
                                                SCM_EXTRA_REPO_ACTION_UPDATE,
                                                $this->getID()));
                $rows = db_numrows($result);
-               for ($i=0; $i<$rows; $i++) {
+               for ($i = 0; $i < $rows; $i++) {
                        $repo_name = db_result($result, $i, 'repo_name');
                        $description = db_result($result, $i, 'description');
                        $clone_url = db_result($result, $i, 'clone_url');
@@ -381,6 +379,48 @@ Offer DAV or SSH access.");
                        if (!preg_match('|^[-a-zA-Z0-9:./_]+$|', $clone_url)) {
                                $clone_url = '';
                        }
+                       $repodir = $root.'/'.$repo_name;
+                       if (!is_dir("$repodir/.hg")) {
+                               if ($clone_url != '') {
+                               } else {
+                                       system("hg init $repodir");
+                               }
+                               $f = fopen("$repodir/.hg/hgrc", 'w');
+                               $conf = "[web]\n";
+                               $conf .= "baseurl = /hg/".$project_name."\n";
+                               $conf .= "description = ".$description."\n";
+                               $conf .= "style = paper\n";
+                               $conf .= "allow_push = *\n"; // every user (see 
Apache configuration) is allowed to push
+                               $conf .= "allow_read = *\n"; // every user is 
allowed to clone and pull
+                               if (!forge_get_config('use_ssl', 'scmhg')) {
+                                       $conf .= "push_ssl = 0\n";
+                               }
+                               fwrite($f, $conf);
+                               fclose($f);
+                               system("chgrp -R $unix_group_rw $repodir");
+                               system("chmod -R g=rwX,o=rX $repodir");
+                               system("chmod 660 $repodir/.hg/hgrc");
+                               }
+                       }
+               }
+
+               // Delete project-wide secondary repositories
+               $result = db_query_params ('SELECT repo_name FROM 
scm_secondary_repos WHERE group_id=$1 AND next_action = $2 AND plugin_id=$3',
+                                          array($project->getID(),
+                                                 SCM_EXTRA_REPO_ACTION_DELETE,
+                                                 $this->getID()));
+               $rows = db_numrows ($result);
+               for ($i = 0; $i < $rows; $i++) {
+                       $repo_name = db_result($result, $i, 'repo_name');
+                       $repodir = $root.'/'.$repo_name;
+                       if (util_is_valid_repository_name($repo_name)) {
+                               system("rm -rf $repodir");
+                       }
+                       db_query_params ('DELETE FROM scm_secondary_repos WHERE 
group_id=$1 AND repo_name=$2 AND next_action = $3 AND plugin_id=$4',
+                                        array($project->getID(),
+                                               $repo_name,
+                                               SCM_EXTRA_REPO_ACTION_DELETE,
+                                               $this->getID()));
                }
        }
 

https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=51d14e798a63715124517f8b9c5048c3b4afbd1a

commit 51d14e798a63715124517f8b9c5048c3b4afbd1a
Author: Franck Villaume <franck.villa...@trivialdev.com>
Date:   Thu Feb 8 19:49:31 2018 +0100

    scm plugins: remove useless code. scmsvn: display snapshots on page

diff --git a/src/plugins/scmarch/common/ArchPlugin.class.php 
b/src/plugins/scmarch/common/ArchPlugin.class.php
index fc6be9e..3718ed2 100644
--- a/src/plugins/scmarch/common/ArchPlugin.class.php
+++ b/src/plugins/scmarch/common/ArchPlugin.class.php
@@ -94,10 +94,6 @@ some control over it to the project's administrator.");
                $snapshot = 
forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar'.util_get_compressed_file_extension();
                $tarball = 
forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar'.util_get_compressed_file_extension();
 
-               if (! $project->usesPlugin ($this->name)) {
-                       return false;
-               }
-
                if (! $project->enableAnonSCM()) {
                        if (file_exists ($snapshot)) unlink ($snapshot) ;
                        if (file_exists ($tarball)) unlink ($tarball) ;
diff --git a/src/plugins/scmbzr/common/BzrPlugin.class.php 
b/src/plugins/scmbzr/common/BzrPlugin.class.php
index ab1912b..1fdca11 100644
--- a/src/plugins/scmbzr/common/BzrPlugin.class.php
+++ b/src/plugins/scmbzr/common/BzrPlugin.class.php
@@ -481,10 +481,6 @@ over it to the project's administrator.");
                $snapshot = 
forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar'.util_get_compressed_file_extension();
                $tarball = 
forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar'.util_get_compressed_file_extension();
 
-               if (! $project->usesPlugin ($this->name)) {
-                       return false;
-               }
-
                if (! $project->enableAnonSCM()) {
                        if (file_exists ($snapshot)) unlink ($snapshot) ;
                        if (file_exists ($tarball)) unlink ($tarball) ;
diff --git a/src/plugins/scmsvn/common/SVNPlugin.class.php 
b/src/plugins/scmsvn/common/SVNPlugin.class.php
index 4de84f9..622745c 100644
--- a/src/plugins/scmsvn/common/SVNPlugin.class.php
+++ b/src/plugins/scmsvn/common/SVNPlugin.class.php
@@ -5,7 +5,7 @@
  * Copyright 2003-2010, Roland Mas, Franck Villaume
  * Copyright 2004, GForge, LLC
  * Copyright 2010, Alain Peyrat <alj...@free.fr>
- * Copyright 2012-2014,2016-2017, Franck Villaume - TrivialDev
+ * Copyright 2012-2014,2016-2018, Franck Villaume - TrivialDev
  * Copyright 2013, French Ministry of National Education
  *
  * This file is part of FusionForge.
@@ -134,10 +134,8 @@ some control over it to the project's administrator.");
        }
 
        function getInstructionsForRW($project) {
-               $b = '';
-
                $module = $this->topModule($project);
-               $b .= html_e('h2', array(), _('Developer Access'));
+               $b = html_e('h2', array(), _('Developer Access'));
                $b .= sprintf(_('Only project developers can access the %s tree 
via this method.'), 'Subversion');
                $b .= '<div id="tabber-svn">';
                $b .= '<ul>';
@@ -216,7 +214,12 @@ some control over it to the project's administrator.");
        }
 
        function getSnapshotPara($project) {
-               return;
+               $b = '';
+               $filename = 
$project->getUnixName().'-scm-latest.tar'.util_get_compressed_file_extension();
+               if 
(file_exists(forge_get_config('scm_snapshots_path').'/'.$filename)) {
+                       $b .= html_e('p', array(), 
'['.util_make_link("/snapshots.php?group_id=".$project->getID(), _('Download 
the nightly snapshot')).']');
+               }
+               return $b;
        }
 
        function getBrowserLinkBlock($project) {
@@ -517,10 +520,6 @@ some control over it to the project's administrator.");
                $snapshot = 
forge_get_config('scm_snapshots_path').'/'.$group_name.'-scm-latest.tar'.util_get_compressed_file_extension();
                $tarball = 
forge_get_config('scm_tarballs_path').'/'.$group_name.'-scmroot.tar'.util_get_compressed_file_extension();
 
-               if (!$project->usesPlugin($this->name)) {
-                       return false;
-               }
-
                if (!$project->enableAnonSCM()) {
                        if (is_file($snapshot)) {
                                unlink($snapshot);

-----------------------------------------------------------------------

Summary of changes:
 src/plugins/scmarch/common/ArchPlugin.class.php |  4 ---
 src/plugins/scmbzr/common/BzrPlugin.class.php   |  4 ---
 src/plugins/scmhg/common/HgPlugin.class.php     | 48 ++++++++++++++++++++-----
 src/plugins/scmsvn/common/SVNPlugin.class.php   | 17 +++++----
 4 files changed, 48 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
Fusionforge-commits@lists.fusionforge.org
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to