Browse code

add new option --multiscan, -m

git-svn: trunk@2616

Tomasz Kojm authored on 2007/01/13 09:02:54
Showing 5 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Jan 13 01:01:40 CET 2007 (tk)
2
+---------------------------------
3
+  * clamdscan: add new option --multiscan, -m
4
+
1 5
 Sat Jan 13 00:59:01 CET 2007 (tk)
2 6
 ---------------------------------
3 7
   * libclamav: extract and scan RAR archives file-by-file (bb#141)
... ...
@@ -55,7 +55,7 @@ int main(int argc, char **argv)
55 55
 	char *clamdscan_accepted[] = { "help", "version", "verbose", "quiet",
56 56
 				  "stdout", "log", "move", "copy", "remove",
57 57
 				  "config-file", "no-summary",
58
-				  "disable-summary", NULL };
58
+				  "disable-summary", "multiscan", NULL };
59 59
 
60 60
 
61 61
     opt = opt_parse(argc, argv, clamscan_shortopt, clamscan_longopt, clamdscan_accepted);
... ...
@@ -151,7 +151,8 @@ void help(void)
151 151
     mprintf("    --move=DIRECTORY                   Move infected files into DIRECTORY\n");
152 152
     mprintf("    --copy=DIRECTORY                   Copy infected files into DIRECTORY\n");
153 153
     mprintf("    --config-file=FILE                 Read configuration from FILE.\n");
154
-    mprintf("    --infected            -i             Only print infected files\n");
154
+    mprintf("    --multiscan           -m           Force MULTISCAN mode\n");
155
+    mprintf("    --infected            -i           Only print infected files\n");
155 156
     mprintf("    --no-summary                       Disable summary at end of scanning\n");
156 157
     mprintf("\n");
157 158
 
... ...
@@ -411,6 +411,9 @@ int client(const struct optstruct *opt, int *infected)
411 411
 
412 412
     *infected = 0;
413 413
 
414
+    if(ncore || opt_check(opt, "multiscan"))
415
+	scantype = "MULTISCAN";
416
+
414 417
     /* parse argument list */
415 418
     if(opt->filename == NULL || strlen(opt->filename) == 0) {
416 419
 	/* scan current directory */
... ...
@@ -422,12 +425,6 @@ int client(const struct optstruct *opt, int *infected)
422 422
 	if((sockd = dconnect(opt)) < 0)
423 423
 	    return 2;
424 424
 
425
-	/* TODO: add a cmdline option to allow using MULTISCAN on systems
426
-	 * without hardware accelerators (but with multiple CPUs)
427
-	 */
428
-	if(ncore)
429
-	    scantype = "MULTISCAN";
430
-
431 425
 	if((ret = dsfile(sockd, scantype, cwd, opt)) >= 0)
432 426
 	    *infected += ret;
433 427
 	else
... ...
@@ -486,9 +483,6 @@ int client(const struct optstruct *opt, int *infected)
486 486
 			if((sockd = dconnect(opt)) < 0)
487 487
 			    return 2;
488 488
 
489
-			if(ncore)
490
-			    scantype = "MULTISCAN";
491
-
492 489
 			if((ret = dsfile(sockd, scantype, fullpath, opt)) >= 0)
493 490
 			    *infected += ret;
494 491
 			else
... ...
@@ -38,6 +38,7 @@ static struct option clamscan_longopt[] = {
38 38
     {"tempdir", 1, 0, 0},
39 39
     {"leave-temps", 0, 0, 0},
40 40
     {"config-file", 1, 0, 0},	    /* clamdscan */
41
+    {"multiscan", 0, 0, 'm'},
41 42
     {"database", 1, 0, 'd'},
42 43
     {"force", 0, 0, 0},
43 44
     {"recursive", 0, 0, 'r'},
... ...
@@ -34,6 +34,9 @@ Read clamd settings from FILE.
34 34
 \fB\-l FILE, \-\-log=FILE\fR
35 35
 Save the scan report to FILE.
36 36
 .TP 
37
+\fB\-m, \-\-multiscan\fR
38
+Always use MULTISCAN instead of CONTSCAN.
39
+.TP
37 40
 \fB\-\-remove\fR
38 41
 Remove infected files. \fBBe careful.\fR
39 42
 .TP