Skip to content

Commit a648820

Browse files
committed
leading/trailing whitespace tries to add empty jailkit section/program
1 parent e0d7bcf commit a648820

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

server/lib/classes/system.inc.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,6 +2369,9 @@ public function create_jailkit_chroot($home_dir, $app_sections = array(), $optio
23692369
# /etc/jailkit/jk_init.ini is the default path, probably not needed?
23702370
$program_args .= ' -c /etc/jailkit/jk_init.ini -j ?';
23712371
foreach($app_sections as $app_section) {
2372+
if ($app_section == '') {
2373+
continue;
2374+
}
23722375
# should check that section exists with jk_init --list ?
23732376
$program_args .= ' ' . escapeshellarg($app_section);
23742377
}
@@ -2448,6 +2451,9 @@ public function create_jailkit_programs($home_dir, $programs = array(), $options
24482451

24492452
$bad_paths = array();
24502453
foreach($programs as $prog) {
2454+
if ($prog == '') {
2455+
continue;
2456+
}
24512457
foreach ($blacklisted_paths_regex as $re) {
24522458
if (preg_match($re, $prog, $matches)) {
24532459
$bad_paths[] = $matches[0];

0 commit comments

Comments
 (0)