From d22277878254cf33fd63ca1bf12b215f4e030a27 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Mon, 04 Jan 2016 05:12:49 -0500
Subject: [PATCH] - merged different fixes and updates from foreign branches
---
server/plugins-available/shelluser_jailkit_plugin.inc.php | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/server/plugins-available/shelluser_jailkit_plugin.inc.php b/server/plugins-available/shelluser_jailkit_plugin.inc.php
index aabbcde..4c400c7 100755
--- a/server/plugins-available/shelluser_jailkit_plugin.inc.php
+++ b/server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -301,7 +301,7 @@
file_put_contents($bashrc, $tpl->grab());
unset($tpl);
- $this->app->log("Added bashrc script : ".$bashrc, LOGLEVEL_DEBUG);
+ $this->app->log("Added bashrc script: ".$bashrc, LOGLEVEL_DEBUG);
$tpl = new tpl();
$tpl->newTemplate("motd.master");
@@ -318,13 +318,21 @@
function _add_jailkit_programs()
{
- //copy over further programs and its libraries
- $command = '/usr/local/ispconfig/server/scripts/create_jailkit_programs.sh';
- $command .= ' '.escapeshellcmd($this->data['new']['dir']);
- $command .= ' \''.$this->jailkit_config['jailkit_chroot_app_programs'].'\'';
- exec($command.' 2>/dev/null');
+ $jailkit_chroot_app_programs = preg_split("/[\s,]+/", $this->jailkit_config['jailkit_chroot_app_programs']);
+ if(is_array($jailkit_chroot_app_programs) && !empty($jailkit_chroot_app_programs)){
+ foreach($jailkit_chroot_app_programs as $jailkit_chroot_app_program){
+ $jailkit_chroot_app_program = trim($jailkit_chroot_app_program);
+ if(is_file($jailkit_chroot_app_program) || is_dir($jailkit_chroot_app_program)){
+ //copy over further programs and its libraries
+ $command = '/usr/local/ispconfig/server/scripts/create_jailkit_programs.sh';
+ $command .= ' '.escapeshellcmd($this->data['new']['dir']);
+ $command .= ' '.$jailkit_chroot_app_program;
+ exec($command.' 2>/dev/null');
- $this->app->log("Added programs to jailkit chroot with command: ".$command, LOGLEVEL_DEBUG);
+ $this->app->log("Added programs to jailkit chroot with command: ".$command, LOGLEVEL_DEBUG);
+ }
+ }
+ }
}
function _get_home_dir($username)
--
Gitblit v1.9.1