diff options
author | Nicolas Vigier <boklm@mageia.org> | 2010-11-10 00:46:53 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2010-11-10 00:46:53 +0000 |
commit | 6aeb5908fe99164270bcb7cfbd055adf5e0d25e2 (patch) | |
tree | 6bfafd132a40a6986471547439e9da6098030ecb /modules/restrictshell/templates/sv_membersh.pl | |
parent | 5a6d8a9920af733fe47f909c7d8aa94cd42a6708 (diff) | |
download | puppet-6aeb5908fe99164270bcb7cfbd055adf5e0d25e2.tar puppet-6aeb5908fe99164270bcb7cfbd055adf5e0d25e2.tar.gz puppet-6aeb5908fe99164270bcb7cfbd055adf5e0d25e2.tar.bz2 puppet-6aeb5908fe99164270bcb7cfbd055adf5e0d25e2.tar.xz puppet-6aeb5908fe99164270bcb7cfbd055adf5e0d25e2.zip |
add support for pkgsubmit in restricted shell
Diffstat (limited to 'modules/restrictshell/templates/sv_membersh.pl')
-rw-r--r-- | modules/restrictshell/templates/sv_membersh.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/restrictshell/templates/sv_membersh.pl b/modules/restrictshell/templates/sv_membersh.pl index e7aaa8cf..521587d0 100644 --- a/modules/restrictshell/templates/sv_membersh.pl +++ b/modules/restrictshell/templates/sv_membersh.pl @@ -61,6 +61,10 @@ our @prepend_args_svn = ( '-r', '/svn' ); our $use_git = "0"; our $bin_git = "/usr/bin/git-shell"; +our $use_pkgsubmit = "0"; +our $regexp_pkgsubmit = "^/usr/share/repsys/create-srpm "; +our $bin_pkgsubmit = "/usr/share/repsys/create-srpm"; + # Open configuration file if (-e "/etc/membersh-conf.pl") { do "/etc/membersh-conf.pl" or die "System misconfiguration, contact administrators. Exiting"; @@ -86,6 +90,8 @@ if (-e "/etc/membersh-conf.pl") { # $bin_rsync = "/usr/bin/rsync"; # $regexp_rsync = "^rsync --server"; # $regexp_dir_rsync = "^(/upload)|(/var/ftp)"; +# +# $use_pkgsubmit = "1"; if ($#ARGV == 1 and $ARGV[0] eq "-c") { @@ -133,7 +139,12 @@ if ($#ARGV == 1 and $ARGV[0] eq "-c") { # Delegate filtering to git-shell exec($bin_git, @ARGV) or die("Failed to exec $bin_git: $!"); + } elsif ($use_pkgsubmit and + $ARGV[1] =~ m:$regexp_pkgsubmit:) { + + my ($createsrpm, @rest) = split(' ', $ARGV[1]); + exec($bin_pkgsubmit, @rest) or die("Failed to exec $bin_pkgsubmit: $!"); } } |