Skip to content

Commit ac32a44

Browse files
committed
Improved user delete code for non jailkit users.
1 parent 396f0e6 commit ac32a44

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

server/plugins-available/shelluser_base_plugin.inc.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,14 @@ function delete($event_name,$data) {
148148
// Get the UID of the user
149149
$userid = intval($app->system->getuid($data['old']['username']));
150150
if($userid > $this->min_uid) {
151-
$command = 'userdel -f';
152-
$command .= ' '.escapeshellcmd($data['old']['username']);
151+
// We delete only non jailkit users, jailkit users will be deleted by the jailkit plugin.
152+
if ($data['old']['chroot'] != "jailkit") {
153+
$command = 'userdel -f';
154+
$command .= ' '.escapeshellcmd($data['old']['username']);
153155

154-
exec($command);
155-
$app->log("Deleted shelluser: ".$data['old']['username'],LOGLEVEL_DEBUG);
156+
exec($command);
157+
$app->log("Deleted shelluser: ".$data['old']['username'],LOGLEVEL_DEBUG);
158+
}
156159

157160
} else {
158161
$app->log("UID = $userid for shelluser:".$data['old']['username']." not allowed.",LOGLEVEL_ERROR);

0 commit comments

Comments
 (0)