Browse code

define set of recommended scan options

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@827 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/09/05 06:30:11
Showing 3 changed files
... ...
@@ -1,3 +1,8 @@
1
+Sat Sep  4 23:27:12 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav/clamav.h: define set of recommended scan options (CL_STDOPT)
4
+  * examples/ex1.c: update
5
+
1 6
 Sat Sep  4 23:07:05 CEST 2004 (tk)
2 7
 ----------------------------------
3 8
   * clamscan: add support for special files in stdin mode
... ...
@@ -73,20 +73,19 @@ int main(int argc, char **argv)
73 73
     limits.maxratio = 200; /* maximal compression ratio */
74 74
     limits.archivememlim = 0; /* disable memory limit for bzip2 scanner */
75 75
 
76
-    /* scan descriptor (with archive and mail scanning enabled) */
77
-    if((ret = cl_scandesc(fd, &virname, &size, root, &limits, CL_ARCHIVE | CL_MAIL | CL_OLE2)) == CL_VIRUS)
76
+    /* scan descriptor */
77
+    if((ret = cl_scandesc(fd, &virname, &size, root, &limits, CL_STDOPT)) == CL_VIRUS)
78 78
 	printf("Virus detected: %s\n", virname);
79 79
     else {
80 80
 	printf("No virus detected.\n");
81 81
 	if(ret != CL_CLEAN)
82 82
 	    printf("Error: %s\n", cl_perror(ret));
83 83
     }
84
+    close(fd);
84 85
 
85 86
     mb = size * (CL_COUNT_PRECISION / 1024) / 1024.0;
86 87
     printf("Data scanned: %2.2Lf Mb\n", mb);
87 88
 
88 89
     cl_free(root);
89
-
90
-    close(fd);
91 90
     exit(ret == CL_VIRUS ? 1 : 0);
92 91
 }
... ...
@@ -76,6 +76,8 @@ extern "C"
76 76
 #define CL_BROKEN	128
77 77
 #define CL_MAILURL	256
78 78
 
79
+/* recommended options */
80
+#define CL_STDOPT	(CL_ARCHIVE | CL_MAIL | CL_OLE2 | CL_HTML | CL_PE) 
79 81
 
80 82
 struct cli_bm_patt {
81 83
     char *pattern;