threads / patch / 22395

patchgit-cvsserver: allow regex metacharacters in CVSROOT

Subject: [PATCH] git-cvsserver: allow regex metacharacters in CVSROOT

## tl;dr

One message between Jan 26, 2010 and Jan 26, 2010. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Gerrit Pape· Jan 26, 2010, 14:47 UTC · lore

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>
---
 git-cvsserver.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to git-cvsserver.perl +1 −1
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 2804106..13751db 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -408,7 +408,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/ );
 
-- 
1.6.6

← back to recent threads