From f331a0dee00cc16231a70492f0c39d0da1082ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Webdesign=20H=C3=B6hne?= Date: Thu, 18 Sep 2014 15:17:03 +0200 Subject: [PATCH] vtigercron.php patch for some servers PHP_SAPI is no 100% secure way to find out if the script is started from shell. Added a $_SERVER['SHELL'] check --- vtigercron.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vtigercron.php b/vtigercron.php index f8505de5..ffff6be0 100644 --- a/vtigercron.php +++ b/vtigercron.php @@ -15,7 +15,13 @@ */ include_once 'vtlib/Vtiger/Cron.php'; require_once 'config.inc.php'; -if(PHP_SAPI === "cli" || (isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key)){ + +$clientcomesfromshell = false; +if (PHP_SAPI === "cli" || isset($_SERVER["SHELL"]) && ( $_SERVER['SHELL'] == '/bin/bash' || $_SERVER['SHELL'] == '/bin/sh' )){ + $clientcomesfromshell = true; +} + +if ($clientcomesfromshell === true || (isset($_SESSION["authenticated_user_id"]) && isset($_SESSION["app_unique_key"]) && $_SESSION["app_unique_key"] == $application_unique_key)){ $cronTasks = false; if (isset($_REQUEST['service'])) { @@ -64,4 +70,4 @@ echo("Access denied!"); } -?> \ No newline at end of file +?>