Browse code

freshclam: new option Bytecode

Tomasz Kojm authored on 2010/02/02 22:23:40
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Feb  2 14:23:18 CET 2010 (tk)
2
+---------------------------------
3
+ * freshclam: new option Bytecode
4
+
1 5
 Mon Feb  1 19:25:45 CET 2010 (tk)
2 6
 ---------------------------------
3 7
  * sigtool: add support for bytecode.cvd
... ...
@@ -173,3 +173,8 @@ DatabaseMirror database.clamav.net
173 173
 # and http://safebrowsing.clamav.net for more information.
174 174
 # Default: disabled
175 175
 #SafeBrowsing yes
176
+
177
+# This option enables downloading of bytecode.cvd, which includes additional
178
+# detection mechanisms and improvements to the ClamAV engine.
179
+# Default: enabled
180
+#Bytecode yes
... ...
@@ -1859,6 +1859,31 @@ int downloadmanager(const struct optstruct *opts, const char *hostname, const ch
1859 1859
     } else if(ret == 0)
1860 1860
 	updated = 1;
1861 1861
 
1862
+    if(!optget(opts, "Bytecode")->enabled) {
1863
+	    const char *dbname = NULL;
1864
+
1865
+	if(!access("bytecode.cvd", R_OK))
1866
+	    dbname = "bytecode.cvd";
1867
+	else if(!access("bytecode.cld", R_OK))
1868
+            dbname = "bytecode.cld";
1869
+
1870
+	if(dbname) {
1871
+	    if(unlink(dbname))
1872
+		logg("^Bytecode is disabled but can't remove old %s\n", dbname);
1873
+	    else
1874
+		logg("*%s removed\n", dbname);
1875
+	}
1876
+    } else if((ret = updatedb("bytecode", hostname, ipaddr, &signo, opts, dnsreply, localip, outdated, &mdat, logerr)) > 50) {
1877
+	if(dnsreply)
1878
+	    free(dnsreply);
1879
+
1880
+	if(newver)
1881
+	    free(newver);
1882
+
1883
+	mirman_write("mirrors.dat", &mdat);
1884
+	return ret;
1885
+    } else if(ret == 0)
1886
+	updated = 1;
1862 1887
     if(dnsreply)
1863 1888
 	free(dnsreply);
1864 1889
 
... ...
@@ -372,6 +372,8 @@ const struct clam_option __clam_options[] = {
372 372
 
373 373
     { "SafeBrowsing", NULL, 0, TYPE_BOOL, MATCH_BOOL, 0, NULL, 0, OPT_FRESHCLAM, "This option enables support for Google Safe Browsing. When activated for\nthe first time, freshclam will download a new database file (safebrowsing.cvd)\nwhich will be automatically loaded by clamd and clamscan during the next\nreload, provided that the heuristic phishing detection is turned on. This\ndatabase includes information about websites that may be phishing sites or\npossible sources of malware. When using this option, it's mandatory to run\nfreshclam at least every 30 minutes.\nFreshclam uses the ClamAV's mirror infrastructure to distribute the\ndatabase and its updates but all the contents are provided under Google's\nterms of use. See http://code.google.com/support/bin/answer.py?answer=70015\nand http://safebrowsing.clamav.net for more information.", "yes" },
374 374
 
375
+    { "Bytecode", NULL, 0, TYPE_BOOL, MATCH_BOOL, 1, NULL, 0, OPT_FRESHCLAM, "This option enables downloading of bytecode.cvd, which includes additional\ndetection mechanisms and improvements to the ClamAV engine.", "yes" },
376
+
375 377
     /* Deprecated options */
376 378
 
377 379
     { "MailMaxRecursion", NULL, 0, TYPE_NUMBER, NULL, -1, NULL, 0, OPT_CLAMD | OPT_DEPRECATED, "", "" },