aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitaram Chamarty <sitaram@atc.tcs.com>2016-02-06 08:54:37 +0530
committerSitaram Chamarty <sitaram@atc.tcs.com>2016-02-06 10:22:24 +0530
commit6c59f2a53bca782ac606ca78526235da74f1fe33 (patch)
tree4e8a47eea0a84c79e0e9d5ecd84b03f3d1756c44
parentwho-pushed: avoid undefined variable warnings before printing usage (diff)
downloadgitolite-gentoo-6c59f2a53bca782ac606ca78526235da74f1fe33.tar.gz
gitolite-gentoo-6c59f2a53bca782ac606ca78526235da74f1fe33.tar.bz2
gitolite-gentoo-6c59f2a53bca782ac606ca78526235da74f1fe33.zip
allow creator check to be bypassed during mirroring...
The original, intended, purpose of wild repos is that they belong to the user, and if the user is gone, so should his wild repos. However, it seems people are using the wild repos thing as a convenience to avoid creating actual repo stanzas in the conf file. For them, the actual creator of a repo is more like the gitolite "admin" - his *authority* is being to used to create something, but the thing that is created is not tied to his *identity*. Oh well... so be it! To use, just add option bypass-creator-check = 1 to the rules for the repo.
-rwxr-xr-xsrc/commands/perms6
-rw-r--r--src/lib/Gitolite/Triggers/Mirroring.pm2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/commands/perms b/src/commands/perms
index 30984bf..66ae885 100755
--- a/src/commands/perms
+++ b/src/commands/perms
@@ -53,8 +53,10 @@ if ( $ARGV[0] eq '-c' ) {
_die "invalid repo '$repo'" unless $repo =~ $REPONAME_PATT;
if ( not -d "$rc{GL_REPO_BASE}/$repo.git" ) {
- my $ret = Gitolite::Conf::Load::access( $repo, $ENV{GL_USER}, '^C', 'any' );
- _die $generic_error if $ret =~ /DENIED/;
+ unless ($ENV{GL_BYPASS_CREATOR_CHECK}) {
+ my $ret = Gitolite::Conf::Load::access( $repo, $ENV{GL_USER}, '^C', 'any' );
+ _die $generic_error if $ret =~ /DENIED/;
+ }
require Gitolite::Conf::Store;
Gitolite::Conf::Store->import;
diff --git a/src/lib/Gitolite/Triggers/Mirroring.pm b/src/lib/Gitolite/Triggers/Mirroring.pm
index 04140fd..860e6d0 100644
--- a/src/lib/Gitolite/Triggers/Mirroring.pm
+++ b/src/lib/Gitolite/Triggers/Mirroring.pm
@@ -36,8 +36,10 @@ sub input {
_die "$hn: '$repo' is native" if $mode eq 'master';
_die "$hn: '$sender' is not the master for '$repo'" if $master ne $sender;
+ $ENV{GL_BYPASS_CREATOR_CHECK} = option($repo, "bypass-creator-check");
# this expects valid perms content on STDIN
_system("gitolite perms -c $repo");
+ delete $ENV{GL_BYPASS_CREATOR_CHECK};
# we're done. Yes, really...
exit 0;