Browse code

libclamav: fix detection of Worm.Mydoom.M.log and control it with CL_SCAN_ALGORITHMIC and dconf (bb#1241)

git-svn: trunk@4291

Tomasz Kojm authored on 2008/10/24 18:21:54
Showing 5 changed files
... ...
@@ -1,3 +1,8 @@
1
+Fri Oct 24 11:45:41 CEST 2008 (tk)
2
+----------------------------------
3
+ * libclamav: fix detection of Worm.Mydoom.M.log and control it with
4
+	      CL_SCAN_ALGORITHMIC and dconf (bb#1241)
5
+
1 6
 Thu Oct 23 23:01:10 EEST 2008 (edwin)
2 7
 -------------------------------------
3 8
  * clamd/scanner.c: fix leak on rare error path (bb #1254)
... ...
@@ -101,6 +101,7 @@ static struct dconf_module modules[] = {
101 101
     { "OTHER",	    "JPEG",	    OTHER_CONF_JPEG,	    1 },
102 102
     { "OTHER",	    "CRYPTFF",	    OTHER_CONF_CRYPTFF,	    1 },
103 103
     { "OTHER",	    "DLP",	    OTHER_CONF_DLP,	    1 },
104
+    { "OTHER",	    "MYDOOMLOG",    OTHER_CONF_MYDOOMLOG,   1 },
104 105
 
105 106
     { "PHISHING",   "ENGINE",       PHISHING_CONF_ENGINE,   1 },
106 107
     { "PHISHING",   "ENTCONV",      PHISHING_CONF_ENTCONV,  1 },
... ...
@@ -92,6 +92,7 @@ struct cli_dconf {
92 92
 #define OTHER_CONF_JPEG	    0x8
93 93
 #define OTHER_CONF_CRYPTFF  0x10
94 94
 #define OTHER_CONF_DLP	    0x20
95
+#define OTHER_CONF_MYDOOMLOG	0x40
95 96
 
96 97
 /* Phishing flags */
97 98
 #define PHISHING_CONF_ENGINE   0x1
... ...
@@ -2044,7 +2044,8 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
2044 2044
 	    break;
2045 2045
 
2046 2046
 	case CL_TYPE_BINARY_DATA:
2047
-	    ret = cli_check_mydoom_log(desc, ctx->virname);
2047
+	    if(SCAN_ALGO && (DCONF_OTHER & OTHER_CONF_MYDOOMLOG))
2048
+		ret = cli_check_mydoom_log(desc, ctx->virname);
2048 2049
 	    break;
2049 2050
 
2050 2051
 	case CL_TYPE_TEXT_ASCII:
... ...
@@ -58,6 +58,8 @@ int cli_check_mydoom_log(int desc, const char **virname)
58 58
 	if (cli_readn(desc, &record, 32) != 32) {
59 59
 	    break;
60 60
 	}
61
+	if(!j && record[0] == 0xffffffff) /* bb#1241 */
62
+	    return CL_CLEAN;
61 63
 
62 64
 	/* Decode the key */
63 65
 	record[0] = ~ntohl(record[0]);