From 96aba17f013a8457d154a7ba5c85451cfd69d239 Mon Sep 17 00:00:00 2001 From: Bram Schoenmakers Date: Wed, 17 Sep 2014 19:05:52 +0200 Subject: [PATCH] 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. --- plugins/updater/init.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/updater/init.php b/plugins/updater/init.php index ef48858b..6ee018f7 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; -- 2.39.5