Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-5800

False positive from Clam AV with .zip files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • None
    • 1.6
    • Antivirus, Libraries
    • None
    • All
    • MOODLE_16_STABLE

      Hi,

      Clam AV handle compressed file that exceeds default compression ratio as virus (see question 36 in http://www.clamav.net/faq.html)

      If you run clamscan from command line, you can disable this behavior using option --max-ratio=0

      So, can be useful passing options when clam is invoked by Moodle too.

      Following patch in lib/uploadlib.php allow to pass option to clam.

      Just replace:

      if (!$CFG->pathtoclam // !file_exists($CFG-pathtoclam) // !is_executable($CFG->pathtoclam)) {

      whith:

      $optpos = strpos($CFG->pathtoclam, -);

      if ($optpos === false)

      { $clampath = trim($CFG->pathtoclam); }

      else

      { $clampath = trim(substr($CFG->pathtoclam, 0, $optpos)); }

      if (!$clampath // !file_exists($clampath) // !is_executable($clampath)) {

            danmarsden Dan Marsden
            imported Imported (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.