Skip to content

Commit c753586

Browse files
committed
Check for .lock_homephp only on Debian/Ubuntu
1 parent 434666e commit c753586

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

server/plugins-available/shelluser_jailkit_plugin.inc.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -812,10 +812,12 @@ function _setup_shell_php() {
812812
// The symlink will be recreated later in this function, regardless of the chosen shell.
813813
// In case you want to keep the symlink in .home/php, you can create a lock file ".lock_homephp" in the same directory.
814814
// This can be useful if you want to keep the PHP binary in the jailkit chroot for some reason, instead of /etc/alternatives/php if you use a OS that uses alternatives.
815-
if(file_exists($web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/php') && !file_exists($web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/.lock_homephp')) {
816-
unlink($web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/php');
817-
} else {
818-
$app->log("Lock file .lock_homephp for PHP exists in " . $web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/.lock_homephp', LOGLEVEL_DEBUG);
815+
if($used_os_type == "debian" || $used_os_type == "ubuntu") {
816+
if(file_exists($web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/php') && !file_exists($web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/.lock_homephp')) {
817+
unlink($web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/php');
818+
} else {
819+
$app->log("Lock file .lock_homephp for PHP exists in " . $web_docroot . '/home/' . $this->data['new']['username'] . '/.local/bin/.lock_homephp', LOGLEVEL_DEBUG);
820+
}
819821
}
820822

821823

0 commit comments

Comments
 (0)