Code

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 6dc45f5d45a44c9bbe31987c1a10e4554f037d6c..046f5578a11f2d0dc5326b4b4593b0093f006b15 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/ );