aboutsummaryrefslogtreecommitdiffstats
path: root/modules/restrictshell
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2010-11-10 00:46:53 +0000
committerNicolas Vigier <boklm@mageia.org>2010-11-10 00:46:53 +0000
commit6aeb5908fe99164270bcb7cfbd055adf5e0d25e2 (patch)
tree6bfafd132a40a6986471547439e9da6098030ecb /modules/restrictshell
parent5a6d8a9920af733fe47f909c7d8aa94cd42a6708 (diff)
downloadpuppet-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')
-rwxr-xr-xmodules/restrictshell/templates/membersh-conf.pl3
-rw-r--r--modules/restrictshell/templates/sv_membersh.pl11
2 files changed, 14 insertions, 0 deletions
diff --git a/modules/restrictshell/templates/membersh-conf.pl b/modules/restrictshell/templates/membersh-conf.pl
index ee80052f..0d9887e1 100755
--- a/modules/restrictshell/templates/membersh-conf.pl
+++ b/modules/restrictshell/templates/membersh-conf.pl
@@ -11,3 +11,6 @@ $use_rsync = "<%= allow_rsync %>";
$bin_rsync = "/usr/bin/rsync";
$regexp_rsync = "^rsync --server";
$regexp_dir_rsync = "^/.*";
+
+$use_pkgsubmit = "<%= allow_pkgsubmit %>";
+
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: $!");
}
}