aboutsummaryrefslogtreecommitdiffstats
path: root/modules/restrictshell
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-08-17 14:20:05 +0000
committerNicolas Vigier <boklm@mageia.org>2011-08-17 14:20:05 +0000
commita7e1e6804f7f28116e930963afc32900cac8c561 (patch)
tree0d3a6263d82d19f6d0d40a91ef3c96b14f109f8e /modules/restrictshell
parent5924d2f911adebdf50e04bffe0e0b16ac1ce4027 (diff)
downloadpuppet-a7e1e6804f7f28116e930963afc32900cac8c561.tar
puppet-a7e1e6804f7f28116e930963afc32900cac8c561.tar.gz
puppet-a7e1e6804f7f28116e930963afc32900cac8c561.tar.bz2
puppet-a7e1e6804f7f28116e930963afc32900cac8c561.tar.xz
puppet-a7e1e6804f7f28116e930963afc32900cac8c561.zip
add support for upload-bin
Diffstat (limited to 'modules/restrictshell')
-rw-r--r--modules/restrictshell/manifests/init.pp5
-rw-r--r--modules/restrictshell/templates/sv_membersh.pl10
2 files changed, 15 insertions, 0 deletions
diff --git a/modules/restrictshell/manifests/init.pp b/modules/restrictshell/manifests/init.pp
index c4f1151b..bf1dfd04 100644
--- a/modules/restrictshell/manifests/init.pp
+++ b/modules/restrictshell/manifests/init.pp
@@ -64,6 +64,11 @@ class restrictshell {
class allow_maintdb {
allow{ "maintdb": }
}
+
+ class allow_upload_bin {
+ allow{ "upload_bin": }
+ }
+
# technically, we could add cvs too
# but I doubt we will use it one day
diff --git a/modules/restrictshell/templates/sv_membersh.pl b/modules/restrictshell/templates/sv_membersh.pl
index f200728d..002062de 100644
--- a/modules/restrictshell/templates/sv_membersh.pl
+++ b/modules/restrictshell/templates/sv_membersh.pl
@@ -69,6 +69,10 @@ our $use_maintdb = "0";
our $regexp_maintdb = "^/usr/local/bin/wrapper.maintdb ";
our $bin_maintdb = "/usr/local/bin/wrapper.maintdb";
+our $use_upload_bin = "0";
+our $regexp_upload_bin = "^/usr/local/bin/wrapper.upload-bin ";
+our $bin_upload_bin = "/usr/local/bin/wrapper.upload-bin";
+
# Open configuration file
if (-e "/etc/membersh-conf.pl") {
do "/etc/membersh-conf.pl" or die "System misconfiguration, contact administrators. Exiting";
@@ -98,6 +102,8 @@ if (-e "/etc/membersh-conf.pl") {
# $use_pkgsubmit = "1";
#
# $use_maintdb = "1";
+#
+# $use_upload_bin = "1";
if ($#ARGV == 1 and $ARGV[0] eq "-c") {
@@ -155,6 +161,10 @@ if ($#ARGV == 1 and $ARGV[0] eq "-c") {
$ARGV[1] =~ m:$regexp_maintdb:) {
my ($maintdb, @rest) = split(' ', $ARGV[1]);
exec($bin_maintdb, @rest) or die("Failed to exec $bin_maintdb: $!");
+ } elsif ($use_upload_bin and
+ $ARGV[1] =~ m:$regexp_upload_bin:) {
+ my ($upload_bin, @rest) = split(' ', $ARGV[1]);
+ exec($bin_upload_bin, @rest) or die("Failed to exec $bin_upload_bin: $!");
}
}