aboutsummaryrefslogtreecommitdiffstats
path: root/modules/restrictshell
diff options
context:
space:
mode:
Diffstat (limited to 'modules/restrictshell')
-rw-r--r--modules/restrictshell/manifests/allow.pp4
-rw-r--r--modules/restrictshell/manifests/shell.pp2
-rwxr-xr-xmodules/restrictshell/templates/membersh-conf.pl4
-rw-r--r--modules/restrictshell/templates/sv_membersh.pl9
4 files changed, 10 insertions, 9 deletions
diff --git a/modules/restrictshell/manifests/allow.pp b/modules/restrictshell/manifests/allow.pp
index 361ee4a7..cb1fd9a2 100644
--- a/modules/restrictshell/manifests/allow.pp
+++ b/modules/restrictshell/manifests/allow.pp
@@ -1,7 +1,7 @@
define restrictshell::allow {
include shell
- file { "/etc/membersh-conf.d/allow_$name.pl":
+ file { "/etc/membersh-conf.d/allow_${name}.pl":
mode => '0755',
- content => "\$use_$name = 1;\n",
+ content => "\$use_${name} = 1;\n",
}
}
diff --git a/modules/restrictshell/manifests/shell.pp b/modules/restrictshell/manifests/shell.pp
index 77044ed4..3ef2a036 100644
--- a/modules/restrictshell/manifests/shell.pp
+++ b/modules/restrictshell/manifests/shell.pp
@@ -3,7 +3,7 @@ class restrictshell::shell {
ensure => directory,
}
- mga-common::local_script { 'sv_membersh.pl':
+ mga_common::local_script { 'sv_membersh.pl':
content => template('restrictshell/sv_membersh.pl'),
}
diff --git a/modules/restrictshell/templates/membersh-conf.pl b/modules/restrictshell/templates/membersh-conf.pl
index ea7d2957..9e0c8bf5 100755
--- a/modules/restrictshell/templates/membersh-conf.pl
+++ b/modules/restrictshell/templates/membersh-conf.pl
@@ -5,13 +5,13 @@ $regexp_svn = "^svnserve -t\$";
#@prepend_args_svn = ( '-r', '/svn' );
@prepend_args_svn = ();
-$bin_git = "/usr/bin/git-shell";
+$bin_git = "/usr/share/gitolite/gitolite-shell";
$bin_rsync = "/usr/bin/rsync";
$regexp_rsync = "^rsync --server";
$regexp_dir_rsync = "^/.*";
-$bin_sftp = "<%= lib_dir %>/ssh/sftp-server";
+$bin_sftp = "<%= @lib_dir %>/ssh/sftp-server";
$regexp_sftp = "^(/usr/lib{64,}/ssh/sftp-server|/usr/lib/sftp-server|/usr/libexec/sftp-server|/usr/lib/openssh/sftp-server)";
foreach my $f (glob("/etc/membersh-conf.d/allow_*pl")) {
diff --git a/modules/restrictshell/templates/sv_membersh.pl b/modules/restrictshell/templates/sv_membersh.pl
index 155bc300..0b07f23a 100644
--- a/modules/restrictshell/templates/sv_membersh.pl
+++ b/modules/restrictshell/templates/sv_membersh.pl
@@ -147,10 +147,11 @@ 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:) {
@@ -169,7 +170,7 @@ if ($#ARGV == 1 and $ARGV[0] eq "-c") {
}
unless (-e "/etc/membersh-errormsg") {
- if ($ARGV) {
+ if (@ARGV) {
print STDERR "You tried to execute: @ARGV[1..$#ARGV]\n";
} else {
print STDERR "You tried to run a interactive shell.\n"