ClamAV Plugin Config Paths

ClamAV Plugin Config Paths

by Wolf Ventir -
Number of replies: 3

Hello all,


I am attempting to get the ClamAV AntiVirus plugin operational.


I have disabled setting executable paths (as recommended by the security guidelines/security report) with the following option:

$CFG->preventexecpath = true;


This prevents the ClamAV path from being set in the Plugin (as it should)

However, I have attempted to set the following option:

$CFG->pathtoclam = '/usr/bin/clamscan';


And it does not work, it remains empty. This option DOES work on older Moodle 2.x branches from when AntiVirus was not a plugin but a Security menu item.


How can I set this plugins requirements utilizing the configuration file? 

Average of ratings: -
In reply to Wolf Ventir

Re: ClamAV Plugin Config Paths

by Wolf Ventir -

Yikes no response. 

I guess Ill need to disable the Best Practices disallow system paths, set it, and then reenable the security setting. 

In reply to Wolf Ventir

Re: ClamAV Plugin Config Paths

by Ruslan Kabalin -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Peer reviewers Picture of Plugin developers

Hello Wolf,

$CFG->pathtoclam
has been deprecated with introduction of antivirus plugins in 3.1.

Instead use:

$CFG->preventexecpath = true;
$CFG->forced_plugin_settings = array('antivirus_clamav' => array('pathtoclam' => '/usr/bin/clamscan'));

Hope this helps.

Average of ratings: Useful (2)