[pmg-devel] [PATCH pmg-api 1/2] freshclam.conf.in: make ScriptedUpdates a variable

Stoiko Ivanov s.ivanov at proxmox.com
Fri Apr 3 19:57:59 CEST 2020


The 'ScriptedUpdate' setting in freshclam.conf (5) defines whether signature
updates should be fetched incrementally or whether the whole database should
be downloaded.

Since the upgrade of clamav to 0.102.1 led to some problems when downloading
the complete file [0], and some users who switched to incremental updates
later had problems with that, it seems the most comfortable and futureproof
solution is to have a simple way for users to selectively switch to
whichever mechanism works. AFAIR signature downloads of clamav also had
similar problems in previous versions.

Additionally the rendered boolean value was changed from 'yes' to 'true',
to be a bit more consistent with the other booleans in our template.

[0] https://blog.clamav.net/2020/02/clamav-01022-security-patch-released.html

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 src/PMG/Config.pm               | 6 ++++++
 src/templates/freshclam.conf.in | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
index 4a0ca2c..458d88e 100755
--- a/src/PMG/Config.pm
+++ b/src/PMG/Config.pm
@@ -387,6 +387,11 @@ sub properties {
 	    type => 'boolean',
 	    default => 1
 	},
+	scriptedupdates => {
+	    description => "Enables ScriptedUpdates (incremental download of signatures)",
+	    type => 'boolean',
+	    default => 0
+	},
     };
 }
 
@@ -400,6 +405,7 @@ sub options {
 	dbmirror => { optional => 1 },
 	maxcccount => { optional => 1 },
 	safebrowsing => { optional => 1 },
+	scriptedupdates => { optional => 1},
     };
 }
 
diff --git a/src/templates/freshclam.conf.in b/src/templates/freshclam.conf.in
index 5119ef0..14e8573 100644
--- a/src/templates/freshclam.conf.in
+++ b/src/templates/freshclam.conf.in
@@ -12,7 +12,7 @@ PidFile /var/run/clamav/freshclam.pid
 DatabaseMirror [% pmg.clamav.dbmirror %]
 ConnectTimeout 30
 ReceiveTimeout 30
-ScriptedUpdates no
+ScriptedUpdates [% IF pmg.clamav.scriptedupdates %]true[% ELSE %]false[% END %]
 CompressLocalDatabase no
 NotifyClamd /etc/clamav/clamd.conf
 Bytecode true
-- 
2.20.1




More information about the pmg-devel mailing list