From: Petr Skoda Date: Tue, 17 Nov 2009 17:32:17 +0000 (+0000) Subject: MDL-20639 fixed mnet security trouble - credit goes to Adrian Schlegel X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3f226cc99f989c886be9858e9eec9fb7a09d14b6;p=moodle.git MDL-20639 fixed mnet security trouble - credit goes to Adrian Schlegel --- diff --git a/mnet/lib.php b/mnet/lib.php index ed38256944..4a02505e8e 100644 --- a/mnet/lib.php +++ b/mnet/lib.php @@ -473,9 +473,10 @@ function mnet_permit_rpc_call($includefile, $functionname, $class=false) { h2s.hostid in ($id_list) AND h2s.publish = '1'"; $params = array("$callprefix/$functionname"); - $permissionobj = $DB->record_exists_sql($sql, $params); - if ($permissionobj === false && 'dangerous' != $CFG->mnet_dispatcher_mode) { + $permission = $DB->count_records_sql($sql, $params); + + if (!$permission && 'dangerous' != $CFG->mnet_dispatcher_mode) { return RPC_FORBIDDENMETHOD; }