Merge branch 'master' into pu (svnserve contrib code)
Conflicts: src/gl-auth-command
This commit is contained in:
commit
3d9f230b41
4 changed files with 54 additions and 5 deletions
|
@ -411,7 +411,7 @@ sub cli_repo_rights {
|
|||
|
||||
sub special_cmd
|
||||
{
|
||||
my ($GL_ADMINDIR, $GL_CONF_COMPILED, $shell_allowed, $RSYNC_BASE, $HTPASSWD_FILE) = @_;
|
||||
my ($GL_ADMINDIR, $GL_CONF_COMPILED, $shell_allowed, $RSYNC_BASE, $HTPASSWD_FILE, $SVNSERVE) = @_;
|
||||
|
||||
my $cmd = $ENV{SSH_ORIGINAL_COMMAND};
|
||||
my $user = $ENV{GL_USER};
|
||||
|
@ -432,6 +432,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
|
||||
&log_it("$ENV{GL_TS}\t$ENV{SSH_ORIGINAL_COMMAND}\t$ENV{GL_USER}\n");
|
||||
|
@ -528,4 +530,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue