git-cvsserver: allow regex metacharacters in CVSROOT
authorGerrit Pape <pape@smarden.org>
Tue, 26 Jan 2010 14:47:16 +0000 (14:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Jan 2010 20:54:18 +0000 (12:54 -0800)
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>
git-cvsserver.perl

index 6dc45f5..046f557 100755 (executable)
@@ -388,7 +388,7 @@ sub req_Directory
     $state->{localdir} = $data;
     $state->{repository} = $repository;
     $state->{path} = $repository;
-    $state->{path} =~ s/^$state->{CVSROOT}\///;
+    $state->{path} =~ s/^\Q$state->{CVSROOT}\E\///;
     $state->{module} = $1 if ($state->{path} =~ s/^(.*?)(\/|$)//);
     $state->{path} .= "/" if ( $state->{path} =~ /\S/ );