]> git.proxmox.com Git - pmg-api.git/commitdiff
new option 'clamav'
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Mar 2018 11:12:14 +0000 (12:12 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Mar 2018 11:12:14 +0000 (12:12 +0100)
This can be used to disable clamav:

Please use carefully!

PMG/Config.pm
PMG/Utils.pm

index 267e3c835027422c16807321bc04b82e029d37a4..b42cfee871aefed0332028e326d2c63dcc7e91c1 100755 (executable)
@@ -97,6 +97,11 @@ sub properties {
            type => 'boolean',
            default => 0,
        },
+       clamav => {
+           description => "Use ClamAV Virus Scanner. This is the default virus scanner and is enabled by default.",
+           type => 'boolean',
+           default => 1,
+       },
     };
 }
 
@@ -104,6 +109,7 @@ sub options {
     return {
        advfilter => { optional => 1 },
        avast => { optional => 1 },
+       clamav => { optional => 1 },
        statlifetime => { optional => 1 },
        dailyreport => { optional => 1 },
        demo => { optional => 1 },
index 6689d10fd44b8101bc448ade64c0111ebd8762ce..46fb89e86c0203c59f230227f56b5b5c153f1d84 100644 (file)
@@ -408,8 +408,15 @@ sub analyze_virus {
        }
     }
 
-    # always scan with clamav
-    return analyze_virus_clam($queue, $filename, $pmg_cfg);
+    my $enable_clamav = $pmg_cfg->get('admin', 'clamav');
+
+    if ($enable_clamav) {
+       if (my $vinfo = analyze_virus_clam($queue, $filename, $pmg_cfg)) {
+           return $vinfo;
+       }
+    }
+
+    return undef;
 }
 
 sub magic_mime_type_for_file {