(mirroring) reject non-local pushes if GL_HOSTNAME not set

We previously said all mirroring features are disabled if GL_HOSTNAME is
not set.

But what if, after mirroring has been setup, and master/slaves defined
for a repo, a slave admin fat-fingers the RC file and accidentally
comments out GL_HOSTNAME?  We might end up violating RULE NUMBER ONE!
This commit is contained in:
Sitaram Chamarty 2011-08-13 13:39:07 +05:30
parent 37ce28a43b
commit a3ffc9d8fd
3 changed files with 8 additions and 4 deletions

View file

@ -1208,9 +1208,11 @@ sub mirror_listslaves {
return ( `git config --file $REPO_BASE/$repo.git/config --get gitolite.mirror.slaves` || '' );
}
# is a redirect ok for this repo from this slave?
sub mirror_redirectOK {
my $repo = shift;
my $slave = shift || '';
my $slave = shift || return 0;
# if we don't know who's asking, the answer is "no"
my $gmrOK = `git config --file $REPO_BASE/$repo.git/config --get gitolite.mirror.redirectOK` || '';
chomp $gmrOK;