Skip to content

Commit be08cde

Browse files
author
Till Brehm
committed
Fixed: Issue #3991 hailed users dont get removed correctly from /etc/passwd
1 parent ebcb3bc commit be08cde

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

server/plugins-available/shelluser_jailkit_plugin.inc.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,14 @@ function delete($event_name, $data) {
245245
//exec('rm -rf '.$data['old']['dir'].$jailkit_chroot_userhome);
246246

247247
$app->system->web_folder_protection($web['document_root'], false);
248+
249+
$userid = intval($app->system->getuid($data['old']['username']));
250+
$command = 'killall -u '.escapeshellcmd($data['old']['username']).' ; ';
251+
$command .= 'userdel -f '.escapeshellcmd($data['old']['username']).' &> /dev/null';
252+
exec($command);
253+
248254

249255
if(@is_dir($data['old']['dir'].$jailkit_chroot_userhome)) {
250-
$userid = intval($app->system->getuid($data['old']['username']));
251-
$command = 'killall -u '.escapeshellcmd($data['old']['username']).' ; userdel -f';
252-
$command .= ' '.escapeshellcmd($data['old']['username']).' &> /dev/null';
253-
exec($command);
254-
255256
$this->_delete_homedir($data['old']['dir'].$jailkit_chroot_userhome,$userid,$data['old']['parent_domain_id']);
256257

257258
$app->log("Jailkit Plugin -> delete chroot home:".$data['old']['dir'].$jailkit_chroot_userhome, LOGLEVEL_DEBUG);

0 commit comments

Comments
 (0)