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

git-cvsserver: allow regex metacharacters in CVSROOT

When run in a repository with a path name containing regex metacharacters (e.g. +), git-cvsserver failed to split the client request into CVSROOT and module. Now metacharacters are disabled for the value of CVSROOT in the perl regex so that directory names containing metacharacters are handled properly. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Gerrit Pape committed Jan 26, 2010 at 14:47 UTC f9acaeae880feb87ae52e719aab930bf1f3e8413
1 file changed +1 -1
git-cvsserver.perl
+1 -1
@@ -388,7 +388,7 @@ sub req_Directory
388 $state->{localdir} = $data;
389 $state->{repository} = $repository;
390 $state->{path} = $repository;
391 - $state->{path} =~ s/^$state->{CVSROOT}\///;
391 + $state->{path} =~ s/^\Q$state->{CVSROOT}\E\///;
392 $state->{module} = $1 if ($state->{path} =~ s/^(.*?)(\/|$)//);
393 $state->{path} .= "/" if ( $state->{path} =~ /\S/ );
394