From d95e868620ef345eb69159334453624827f2e6e6 Mon Sep 17 00:00:00 2001 From: Simon Arlott Date: Sun, 9 May 2010 18:04:54 +0300 Subject: [PATCH] add svnserve exec support --- src/gitolite.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/gitolite.pm b/src/gitolite.pm index 3bc513f..b3efd0c 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -35,6 +35,7 @@ our $REPOPATT_PATT=qr(^\@?[0-9a-zA-Z][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$); # these come from the RC file our ($REPO_UMASK, $GL_WILDREPOS, $GL_PACKAGE_CONF, $GL_PACKAGE_HOOKS); +our ($SVNSERVE); our %repos; # ---------------------------------------------------------------------------- @@ -385,6 +386,8 @@ sub special_cmd &ext_cmd_htpasswd($HTPASSWD_FILE); } elsif ($RSYNC_BASE and $cmd =~ /^rsync /) { &ext_cmd_rsync($GL_CONF_COMPILED, $RSYNC_BASE, $cmd); + } elsif ($SVNSERVE and $cmd eq 'svnserve -t') { + &ext_cmd_svnserve($SVNSERVE); } else { # if the user is allowed a shell, just run the command exec $ENV{SHELL}, "-c", $cmd if $shell_allowed; @@ -480,4 +483,17 @@ EOFhtp die "htpasswd command seems to have failed with $rc return code...\n" if $rc; } +# ---------------------------------------------------------------------------- +# external command helper: svnserve +# ---------------------------------------------------------------------------- + +sub ext_cmd_svnserve +{ + my $SVNSERVE = shift; + + $SVNSERVE =~ s/%u/$ENV{GL_USER}/g; + exec $SVNSERVE; + die "svnserve exec failed\n"; +} + 1;