diff options
author | Bram Schoenmakers <[email protected]> | 2014-09-17 19:05:52 +0200 |
---|---|---|
committer | Bram Schoenmakers <[email protected]> | 2014-09-17 19:24:30 +0200 |
commit | 96aba17f013a8457d154a7ba5c85451cfd69d239 (patch) | |
tree | 5ff4b8bb7311232cb6af5a3eca2ccb68e1df365f /plugins/updater/init.php | |
parent | f8eb8d78acef8beead4882cd46c2a36a3250809f (diff) |
Updater: check whether system() is useable.
system() was disabled on my system for security reasons, but the
updater would just continue, only to find out that the tarball
hasn't been extracted.
Diffstat (limited to 'plugins/updater/init.php')
-rw-r--r-- | plugins/updater/init.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/updater/init.php b/plugins/updater/init.php index ef48858b2..6ee018f74 100644 --- a/plugins/updater/init.php +++ b/plugins/updater/init.php @@ -63,6 +63,20 @@ class Updater extends Plugin { putenv("PATH=" . getenv("PATH") . PATH_SEPARATOR . "/bin" . PATH_SEPARATOR . "/usr/bin"); + array_push($log, "Checking for system() call..."); + + $disabled = explode(',', ini_get('disable_functions')); + foreach ($disabled as $function) { + if ( trim($function) == 'system' ) { + array_push($log, "Can not execute commands with PHP's system() function."); + $stop = true; + } + } + + if ( $stop == true ) { + break; + } + array_push($log, "Checking for tar..."); $system_rc = 0; |