From 95d2ca4ad805791b6a1149a216e26ba61de88e9f Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 14 Jun 2018 18:14:03 +0200 Subject: [PATCH] Fix home initialization for Jailkit. The previous dir (without `./home/$user`) causes usermod to crash when some FPM processes are already launched for the UID (in `server/scripts/create_jailkit_user.sh`), so jk_jailuser is not able to detect the home inside the jail, inserting an empty one in the passwd file, and causing an error when the user want to connect via SSH for example. --- server/plugins-available/shelluser_base_plugin.inc.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php index 9c4568901..323d0a52e 100755 --- a/server/plugins-available/shelluser_base_plugin.inc.php +++ b/server/plugins-available/shelluser_base_plugin.inc.php @@ -107,12 +107,8 @@ class shelluser_base_plugin { $app->system->web_folder_protection($web['document_root'], false); //* Home directory of the new shell user - if($data['new']['chroot'] == 'jailkit') { - $homedir = $data['new']['dir']; - } else { - $homedir = $data['new']['dir'].'/home/'.$data['new']['username']; - } - + $homedir = $data['new']['dir'].'/home/'.$data['new']['username']; + // Create home base directory if it does not exist if(!is_dir($data['new']['dir'].'/home')){ $app->file->mkdirs(escapeshellcmd($data['new']['dir'].'/home'), '0755'); -- GitLab