Commit 95d2ca4a authored by Alexis Lahouze's avatar Alexis Lahouze

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.
parent efab4779
......@@ -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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment