summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 92a39a1)
raw | patch | inline | side by side (parent: 92a39a1)
author | Frank Lichtenheld <frank@lichtenheld.de> | |
Mon, 19 Mar 2007 15:55:59 +0000 (16:55 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 22 Mar 2007 08:26:26 +0000 (01:26 -0700) |
Allow to override the gitcvs.enabled and gitcvs.logfile configuration
variables for each access method (i.e. "ext" or "pserver") in the
form gitcvs.<method>.<var>
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
variables for each access method (i.e. "ext" or "pserver") in the
form gitcvs.<method>.<var>
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-cvsserver.txt | patch | blob | history | |
git-cvsserver.perl | patch | blob | history |
index 1c6f6a7e27d74422085ce32cea1b74c822d1a4b2..f00e6d87e84647b2e4ad059332ce6241fd810a65 100644 (file)
write access to the log file and to the git repository. When offering anon
access via pserver, this means that the nobody user should have write access
to at least the sqlite database at the root of the repository.
+
+Both configuration variables can also be overriden for a specific method of
+access. Valid method names are "ext" (for SSH access) and "pserver". The
+following example configuration would disable pserver access while still
+allowing access over SSH.
+------
+ [gitcvs]
+ enabled=0
+
+ [gitcvs "ext"]
+ enabled=1
+------
--
3. On the client machine you need to set the following variables.
CVSROOT should be set as per normal, but the directory should point at the
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 4edb796019aac56709fd6e186b27250c64cfa200..5d2b6f3575633639a471ff42b472fac68853a0c8 100755 (executable)
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
}
}
- unless ( defined ( $cfg->{gitcvs}{enabled} ) and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i )
+ unless ( ($cfg->{gitcvs}{$state->{method}}{enabled}
+ and $cfg->{gitcvs}{$state->{method}}{enabled} =~ /^\s*(1|true|yes)\s*$/i)
+ or ($cfg->{gitcvs}{enabled}
+ and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i) )
{
print "E GITCVS emulation needs to be enabled on this repo\n";
print "E the repo config file needs a [gitcvs] section added, and the parameter 'enabled' set to 1\n";
return 0;
}
- if ( defined ( $cfg->{gitcvs}{logfile} ) )
+ my $logfile = $cfg->{gitcvs}{$state->{method}}{logfile} || $cfg->{gitcvs}{logfile};
+ if ( $logfile )
{
- $log->setfile($cfg->{gitcvs}{logfile});
+ $log->setfile($logfile);
} else {
$log->nofile();
}