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

False positive from Clam AV with .zip files

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.6
    • Fix Version/s: None
    • Component/s: Antivirus, Libraries
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_16_STABLE

      Description

      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)) {

        Attachments

          Activity

            People

            Assignee:
            danmarsden Dan Marsden
            Reporter:
            imported Imported
            Tester:
            Nobody Nobody
            Participants:
            Component watchers:
            Ruslan Kabalin, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: