Browse code

only scan normalised text with type-7 sigs

git-svn: trunk@3655

Tomasz Kojm authored on 2008/02/19 22:42:24
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Feb 19 13:40:26 CET 2008 (tk)
2
+---------------------------------
3
+  * libclamav/scanners.c: only scan normalised text with type-7 sigs
4
+
1 5
 Tue Feb 19 00:24:01 CET 2008 (tk)
2 6
 ---------------------------------
3 7
   * sigtool/sigtool.c:	- general code cleanup
... ...
@@ -1575,10 +1575,11 @@ static int cli_scanraw(int desc, cli_ctx *ctx, cli_file_t type, uint8_t typercg)
1575 1575
 	return CL_EIO;
1576 1576
     }
1577 1577
 
1578
-    ret = cli_scandesc(desc, ctx, ftrec, type, 0, &ftoffset);
1578
+    ret = cli_scandesc(desc, ctx, ftrec, type == CL_TYPE_TEXT_ASCII ? 0 : type, 0, &ftoffset);
1579 1579
 
1580 1580
     if(ret >= CL_TYPENO) {
1581 1581
 
1582
+/*
1582 1583
 	if(type == CL_TYPE_TEXT_ASCII) {
1583 1584
 	    lseek(desc, 0, SEEK_SET);
1584 1585
 
... ...
@@ -1586,6 +1587,7 @@ static int cli_scanraw(int desc, cli_ctx *ctx, cli_file_t type, uint8_t typercg)
1586 1586
 	    if(nret == CL_VIRUS)
1587 1587
 		cli_dbgmsg("%s found in descriptor %d when scanning file type %u\n", *ctx->virname, desc, ret);
1588 1588
 	}
1589
+*/
1589 1590
 
1590 1591
 	if(nret != CL_VIRUS && (type == CL_TYPE_MSEXE || type == CL_TYPE_ZIP)) {
1591 1592
 	    lastzip = lastrar = 0xdeadbeef;
... ...
@@ -1819,6 +1821,7 @@ int cli_magic_scandesc(int desc, cli_ctx *ctx)
1819 1819
 	    break;
1820 1820
 
1821 1821
 	case CL_TYPE_SCRIPT:
1822
+	case CL_TYPE_TEXT_ASCII:
1822 1823
 	    if(DCONF_DOC & DOC_CONF_SCRIPT)
1823 1824
 	        ret = cli_scanscript(desc, ctx);
1824 1825
 	    break;