From d2212dda734bb8c4b899faab848fa1bd7c1bf66e Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Sun, 19 Sep 2010 08:01:47 -0400 Subject: [PATCH] Fixed bug in maildirmake function: http://www.howtoforge.com/forums/showthread.php?t=48890 --- server/plugins-available/shelluser_base_plugin.inc.php | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php index 3f86b42..69348f5 100755 --- a/server/plugins-available/shelluser_base_plugin.inc.php +++ b/server/plugins-available/shelluser_base_plugin.inc.php @@ -90,13 +90,14 @@ $app->log("Added shelluser: ".$data['new']['username'],LOGLEVEL_DEBUG); //* Create .bash_history file - exec('touch '.escapeshellcmd($data['new']['dir']).'/.bash_history'); - exec('chmod 755 '.escapeshellcmd($data['new']['dir']).'/.bash_history'); - exec('chown '.escapeshellcmd($data['new']['username']).':'.escapeshellcmd($data['new']['pgroup']).' '.escapeshellcmd($data['new']['dir']).'/.bash_history'); + touch(escapeshellcmd($data['new']['dir']).'/.bash_history'); + chmod(escapeshellcmd($data['new']['dir']).'/.bash_history', 0755); + chown(escapeshellcmd($data['new']['dir']).'/.bash_history', escapeshellcmd($data['new']['username'])); + chgrp(escapeshellcmd($data['new']['dir']).'/.bash_history', escapeshellcmd($data['new']['pgroup'])); //* Disable shell user temporarily if we use jailkit if($data['new']['chroot'] == 'jailkit') { - $command = 'usermod -L '.escapeshellcmd($data['new']['username']); + $command = 'usermod -s /bin/false -L '.escapeshellcmd($data['new']['username']); exec($command); $app->log("Disabling shelluser temporarily: ".$command,LOGLEVEL_DEBUG); } @@ -105,7 +106,7 @@ $app->log("UID = $uid for shelluser:".$data['new']['username']." not allowed.",LOGLEVEL_ERROR); } } else { - $app->log("Skippung insert of user:".$data['new']['username'].", parent user ".$data['new']['puser']." does not exist.",LOGLEVEL_WARN); + $app->log("Skipping insertion of user:".$data['new']['username'].", parent user ".$data['new']['puser']." does not exist.",LOGLEVEL_WARN); } } @@ -137,9 +138,10 @@ //* Create .bash_history file if(!is_file($data['new']['dir']).'/.bash_history') { - exec('touch '.escapeshellcmd($data['new']['dir']).'/.bash_history'); - exec('chmod 755 '.escapeshellcmd($data['new']['dir']).'/.bash_history'); - exec('chown '.escapeshellcmd($data['new']['username']).':'.escapeshellcmd($data['new']['pgroup']).' '.escapeshellcmd($data['new']['dir']).'/.bash_history'); + touch(escapeshellcmd($data['new']['dir']).'/.bash_history'); + chmod(escapeshellcmd($data['new']['dir']).'/.bash_history', 0755); + chown(escapeshellcmd($data['new']['dir']).'/.bash_history',escapeshellcmd($data['new']['username'])); + chgrp(escapeshellcmd($data['new']['dir']).'/.bash_history',escapeshellcmd($data['new']['pgroup'])); } } else { @@ -150,7 +152,7 @@ $app->log("UID = $uid for shelluser:".$data['new']['username']." not allowed.",LOGLEVEL_ERROR); } } else { - $app->log("Skippung update for user:".$data['new']['username'].", parent user ".$data['new']['puser']." does not exist.",LOGLEVEL_WARN); + $app->log("Skipping update for user:".$data['new']['username'].", parent user ".$data['new']['puser']." does not exist.",LOGLEVEL_WARN); } } @@ -186,4 +188,4 @@ } // end class -?> \ No newline at end of file +?> -- Gitblit v1.9.1