Skip to content

Commit 5ab1840

Browse files
committed
log if web folder is skipped for update/delete
1 parent a648820 commit 5ab1840

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

server/lib/classes/system.inc.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,6 +2523,10 @@ public function update_jailkit_chroot($home_dir, $sections = array(), $programs
25232523
break;
25242524
default:
25252525
if (preg_match('@^skip[ =]/?(.+)$@', $opt, $matches) ) {
2526+
if (in_array($matches[1], $jailkit_directories)) {
2527+
$app->log("update_jailkit_chroot: skipping update of jailkit directory $home_dir/".$matches[1]
2528+
. "; if this is in use as a web folder, it is insecure and should be fixed.", LOGLEVEL_WARN);
2529+
}
25262530
$jailkit_directories = $app->functions->array_unset_by_value($jailkit_directories, $matches[1]);
25272531
$skips .= ' --skip=/'.escapeshellarg($matches[1]);
25282532
}
@@ -2740,6 +2744,10 @@ public function delete_jailkit_chroot($home_dir, $options = array()) {
27402744
switch ($opt) {
27412745
default:
27422746
if (preg_match('@^skip[ =]/?(.+)$@', $opt, $matches) ) {
2747+
if (in_array($matches[1], $jailkit_directories)) {
2748+
$app->log("delete_jailkit_chroot: skipping removal of jailkit directory .$home_dir/".$matches[1]
2749+
. "; if this is in use as a web folder, it is insecure and should be fixed.", LOGLEVEL_WARN);
2750+
}
27432751
$jailkit_directories = $app->functions->array_unset_by_value($jailkit_directories, $matches[1]);
27442752
}
27452753
break;

0 commit comments

Comments
 (0)