aboutsummaryrefslogtreecommitdiffstats
path: root/modules/restrictshell/templates/sv_membersh.pl
diff options
context:
space:
mode:
Diffstat (limited to 'modules/restrictshell/templates/sv_membersh.pl')
-rw-r--r--modules/restrictshell/templates/sv_membersh.pl39
1 files changed, 33 insertions, 6 deletions
diff --git a/modules/restrictshell/templates/sv_membersh.pl b/modules/restrictshell/templates/sv_membersh.pl
index 521587d0..0b07f23a 100644
--- a/modules/restrictshell/templates/sv_membersh.pl
+++ b/modules/restrictshell/templates/sv_membersh.pl
@@ -62,8 +62,16 @@ 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";
+our $regexp_pkgsubmit = "^/usr/share/repsys/create-srpm |^/usr/local/bin/submit_package ";
+our $bin_pkgsubmit = "/usr/local/bin/submit_package";
+
+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") {
@@ -92,6 +100,10 @@ if (-e "/etc/membersh-conf.pl") {
# $regexp_dir_rsync = "^(/upload)|(/var/ftp)";
#
# $use_pkgsubmit = "1";
+#
+# $use_maintdb = "1";
+#
+# $use_upload_bin = "1";
if ($#ARGV == 1 and $ARGV[0] eq "-c") {
@@ -135,22 +147,37 @@ if ($#ARGV == 1 and $ARGV[0] eq "-c") {
push( @args, @args_user );
exec($bin_svn, @args) or die("Failed to exec $bin_svn: $!");
- } elsif ($use_git and $ARGV[1] =~ m:git-.+:) {
+ } elsif ($use_git and $ARGV[1] =~ m:^$bin_git\b:) {
- # Delegate filtering to git-shell
- exec($bin_git, @ARGV) or die("Failed to exec $bin_git: $!");
+ # Delegate filtering to gitolite-shell
+ my ($gitolite_bin, @rest) = split(' ', $ARGV[1]);
+ exec($bin_git, @rest) 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: $!");
+ } elsif ($use_maintdb and
+ $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: $!");
}
}
unless (-e "/etc/membersh-errormsg") {
- print STDERR "You tried to execute: @ARGV[1..$#ARGV]\n";
+ if (@ARGV) {
+ print STDERR "You tried to execute: @ARGV[1..$#ARGV]\n";
+ } else {
+ print STDERR "You tried to run a interactive shell.\n"
+ }
print STDERR "Sorry, you are not allowed to execute that command.\n";
+ print STDERR "You are member of the following groups :\n";
+ print STDERR qx(groups);
} else {
open(ERRORMSG, "< /etc/membersh-errormsg");
while (<ERRORMSG>) {