diff options
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-x | git-cvsserver.perl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl index 2b4825a8ee..d41b29f30b 100755 --- a/git-cvsserver.perl +++ b/git-cvsserver.perl @@ -167,6 +167,17 @@ sub req_Root my ( $cmd, $data ) = @_; $log->debug("req_Root : $data"); + unless ($data =~ m#^/#) { + print "error 1 Root must be an absolute pathname\n"; + return 0; + } + + if ($state->{CVSROOT} + && ($state->{CVSROOT} ne $data)) { + print "error 1 Conflicting roots specified\n"; + return 0; + } + $state->{CVSROOT} = $data; $ENV{GIT_DIR} = $state->{CVSROOT} . "/"; |