Skip to content

Commit

Permalink
cvsserver: Limit config parser to needed options
Browse files Browse the repository at this point in the history
Change the configuration parser so that it ignores
everything except for ^gitcvs.((ext|pserver).)?
This greatly reduces the risk of failing while
parsing some unknown and irrelevant config option.

The bug that triggered this change was that the
parsing doesn't handle sections that have a
subsection and a variable with the same name.

While this bug still remains, all remaining
causes can be attributed to user error, since
there are no defined variables gitcvs.ext and
gitcvs.pserver.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Frank Lichtenheld authored and Junio C Hamano committed May 13, 2007
1 parent 198a2a8 commit f987afa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ sub req_Root
}
foreach my $line ( @gitvars )
{
next unless ( $line =~ /^(.*?)\.(.*?)(?:\.(.*?))?=(.*)$/ );
unless ($3) {
$cfg->{$1}{$2} = $4;
next unless ( $line =~ /^(gitcvs)\.(?:(ext|pserver)\.)?([\w-]+)=(.*)$/ );
unless ($2) {
$cfg->{$1}{$3} = $4;
} else {
$cfg->{$1}{$2}{$3} = $4;
}
Expand Down

0 comments on commit f987afa

Please sign in to comment.