Re: [PATCH/RFT] cvsserver: only allow checkout of branches
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 4, 2007, 16:32 UTC
- Message-ID
- <Pine.LNX.4.64.0710041731550.4174@racer.site>
- In-Reply-To
- <20071004161812.GA31659@planck.djpig.de>
Hi,
On Thu, 4 Oct 2007, Frank Lichtenheld wrote:
Show 26 quoted lines
> On Thu, Oct 04, 2007 at 04:29:04PM +0100, Johannes Schindelin wrote:
> > Cc'ed Frank, who is de-facto maintainer (according to shortlog)
> > and Martin, who started it all IIRC.
> >
> > diff --git a/git-cvsserver.perl b/git-cvsserver.perl
> > index 13dbd27..869690c 100755
> > --- a/git-cvsserver.perl
> > +++ b/git-cvsserver.perl
> > @@ -770,6 +770,14 @@ sub req_co
> >
> > $log->debug("req_co : " . ( defined($data) ? $data : "[NULL]" ) );
> >
> > + if( system("git", "rev-parse", "--verify", "refs/heads/$module" ) != 0 )
> > + {
> > + $log->warn("Checkout failed: $module is not a branch");
> > + print "error 1 Checkout failed: $module is not a branch\n";
> > + chdir "/";
> > + exit;
> > + }
> > +
> > $log->info("Checking out module '$module' ($state->{CVSROOT}) to '$checkout_path'");
> >
> > $ENV{GIT_DIR} = $state->{CVSROOT} . "/";
>
> Looks good, haven't tested it yet, though. Care to add a testcase
> or should I take care of that?I would be eternally thankful if you could add the test case, since I am really short on time.
Ciao, Dscho