@matheusbsbs / matheus-bagliano / commits / d55820ced6
Fork 0

cvsserver: Allow to override the configuration per access method

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>

Frank Lichtenheld committed Mar 19, 2007 at 16:55 UTC d55820ced668477e07be7d9488c7965906a61b54
2 files changed +19 -3
Documentation/git-cvsserver.txt
+12
@@ -68,6 +68,18 @@ Note: you need to ensure each user that is going to invoke git-cvsserver has
68 write access to the log file and to the git repository. When offering anon
69 access via pserver, this means that the nobody user should have write access
70 to at least the sqlite database at the root of the repository.
71 +
72 +Both configuration variables can also be overriden for a specific method of
73 +access. Valid method names are "ext" (for SSH access) and "pserver". The
74 +following example configuration would disable pserver access while still
75 +allowing access over SSH.
76 +------
77 + [gitcvs]
78 + enabled=0
79 +
80 + [gitcvs "ext"]
81 + enabled=1
82 +------
83 --
84 3. On the client machine you need to set the following variables.
85 CVSROOT should be set as per normal, but the directory should point at the
git-cvsserver.perl
+7 -3
@@ -191,7 +191,10 @@ sub req_Root
191 }
192 }
193
194 - unless ( defined ( $cfg->{gitcvs}{enabled} ) and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i )
194 + unless ( ($cfg->{gitcvs}{$state->{method}}{enabled}
195 + and $cfg->{gitcvs}{$state->{method}}{enabled} =~ /^\s*(1|true|yes)\s*$/i)
196 + or ($cfg->{gitcvs}{enabled}
197 + and $cfg->{gitcvs}{enabled} =~ /^\s*(1|true|yes)\s*$/i) )
198 {
199 print "E GITCVS emulation needs to be enabled on this repo\n";
200 print "E the repo config file needs a [gitcvs] section added, and the parameter 'enabled' set to 1\n";
@@ -200,9 +203,10 @@ sub req_Root
203 return 0;
204 }
205
203 - if ( defined ( $cfg->{gitcvs}{logfile} ) )
206 + my $logfile = $cfg->{gitcvs}{$state->{method}}{logfile} || $cfg->{gitcvs}{logfile};
207 + if ( $logfile )
208 {
205 - $log->setfile($cfg->{gitcvs}{logfile});
209 + $log->setfile($logfile);
210 } else {
211 $log->nofile();
212 }