Skip to content
Snippets Groups Projects
Commit 072be225 authored by Jesse Norell's avatar Jesse Norell
Browse files

jailkit: fix bash test (closes #6042)

parent 1edf68ef
No related branches found
No related tags found
1 merge request!1401jailkit bugfixes
...@@ -114,7 +114,8 @@ class cronjob_jailkit_maintenance extends cronjob { ...@@ -114,7 +114,8 @@ class cronjob_jailkit_maintenance extends cronjob {
if (is_file( $rec['document_root']."/bin/bash" )) { if (is_file( $rec['document_root']."/bin/bash" )) {
# test that /bin/bash functions in the jail # test that /bin/bash functions in the jail
print "chroot --userspec ".$rec['system_user'].":".$rec['system_group']." ".$rec['document_root']." /bin/bash -c true 2>/dev/null\n"; print "chroot --userspec ".$rec['system_user'].":".$rec['system_group']." ".$rec['document_root']." /bin/bash -c true 2>/dev/null\n";
if (! $app->system->exec_safe("chroot --userspec ?:? ? /bin/bash -c true 2>/dev/null", $rec['system_user'], $rec['system_group'], $rec['document_root'])) { $app->system->exec_safe("chroot --userspec ?:? ? /bin/bash -c true 2>/dev/null", $rec['system_user'], $rec['system_group'], $rec['document_root']);
if ($app->system->last_exec_retcode()) { # return 0 means success
print "/bin/bash test failed, forcing update\n"; print "/bin/bash test failed, forcing update\n";
$options[] = 'force'; $options[] = 'force';
# bogus hash will not match, triggering an update # bogus hash will not match, triggering an update
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment