From 99e9ac79849510f74b85a9af1697458dd1731601 Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Wed, 03 Jun 2015 13:02:22 -0400 Subject: [PATCH] Fixed: FS#3906 - Wrong home folder permisions after changing ssh username. --- server/plugins-available/shelluser_base_plugin.inc.php | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php index ca69b5f..6d6dc1d 100755 --- a/server/plugins-available/shelluser_base_plugin.inc.php +++ b/server/plugins-available/shelluser_base_plugin.inc.php @@ -233,7 +233,7 @@ $app->system->chgrp(escapeshellcmd($data['new']['dir'].'/home'),escapeshellcmd($data['new']['pgroup'])); } $app->file->mkdirs(escapeshellcmd($homedir), '0750'); - $app->system->chown(escapeshellcmd($homedir),escapeshellcmd($data['new']['username'])); + $app->system->chown(escapeshellcmd($homedir),escapeshellcmd($data['new']['puser'])); $app->system->chgrp(escapeshellcmd($homedir),escapeshellcmd($data['new']['pgroup'])); $app->system->web_folder_protection($web['document_root'], true); } else { @@ -402,6 +402,12 @@ } $sshrsa = trim($sshrsa); $usrdir = escapeshellcmd($this->data['new']['dir']); + //* Home directory of the new shell user + if($this->data['new']['chroot'] == 'jailkit') { + $usrdir = escapeshellcmd($this->data['new']['dir']); + } else { + $usrdir = escapeshellcmd($this->data['new']['dir'].'/home/'.$this->data['new']['username']); + } $sshdir = $usrdir.'/.ssh'; $sshkeys= $usrdir.'/.ssh/authorized_keys'; -- Gitblit v1.9.1