Browse code

add --include-dir/exclude-dir

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

Tomasz Kojm authored on 2005/03/01 10:32:53
Showing 5 changed files
... ...
@@ -1,3 +1,8 @@
1
+Tue Mar  1 02:29:54 CET 2005 (tk)
2
+---------------------------------
3
+  * clamscan: use --include-dir/exclude-dir for directories instead of
4
+	      --include/exclude
5
+
1 6
 Tue Mar  1 02:16:15 CET 2005 (tk)
2 7
 ---------------------------------
3 8
   * clamscan: respect --exclude/include when entering directories (requested
... ...
@@ -218,10 +218,14 @@ void help(void)
218 218
     mprintf("    --move=DIRECTORY                     Move infected files into DIRECTORY\n");
219 219
 #ifdef HAVE_REGEX_H
220 220
     mprintf("    --exclude=REGEX                      Don't scan file names matching REGEX\n");
221
+    mprintf("    --exclude-dir=REGEX                  Don't scan directories matching REGEX\n");
221 222
     mprintf("    --include=REGEX                      Only scan file names matching REGEX\n");
223
+    mprintf("    --include-dir=REGEX                  Only scan directories matching REGEX\n");
222 224
 #else
223 225
     mprintf("    --exclude=PATT                       Don't scan file names containing PATT\n");
226
+    mprintf("    --exclude-dir=PATT                   Don't scan directories containing PATT\n");
224 227
     mprintf("    --include=PATT                       Only scan file names containing PATT\n");
228
+    mprintf("    --include-dir=PATT                   Only scan directories containing PATT\n");
225 229
 #endif
226 230
 
227 231
     mprintf("\n");
... ...
@@ -83,7 +83,9 @@ int main(int argc, char **argv)
83 83
 	    {"move", 1, 0, 0},
84 84
 	    {"remove", 0, 0, 0},
85 85
 	    {"exclude", 1, 0, 0},
86
+	    {"exclude-dir", 1, 0, 0},
86 87
 	    {"include", 1, 0, 0},
88
+	    {"include-dir", 1, 0, 0},
87 89
 	    {"max-files", 1, 0, 0},
88 90
 	    {"max-space", 1, 0, 0},
89 91
             {"max-ratio", 1, 0, 0},
... ...
@@ -56,8 +56,8 @@ int treewalk(const char *dirname, struct cl_node *root, const struct passwd *use
56 56
 	char *argument;
57 57
 
58 58
 
59
-    if(optl(opt, "exclude")) {
60
-	argument = getfirstargl(opt, "exclude", &optnode);
59
+    if(optl(opt, "exclude-dir")) {
60
+	argument = getfirstargl(opt, "exclude-dir", &optnode);
61 61
 	while(argument) {
62 62
 	    if(match_regex(dirname, argument) == 1) {
63 63
 		if(!printinfected)
... ...
@@ -68,9 +68,9 @@ int treewalk(const char *dirname, struct cl_node *root, const struct passwd *use
68 68
 	}
69 69
     }
70 70
 
71
-   if(optl(opt, "include")) {
71
+   if(optl(opt, "include-dir")) {
72 72
 	included = 0;
73
-	argument = getfirstargl(opt, "include", &optnode);
73
+	argument = getfirstargl(opt, "include-dir", &optnode);
74 74
 	while(argument && !included) {
75 75
 	    if(match_regex(dirname, argument) == 1) {
76 76
 		included = 1;
... ...
@@ -1,5 +1,5 @@
1 1
 .\" Manual page created by Tomasz Kojm, 14/15 IV 2002
2
-.TH "clamscan" "1" "January 26, 2005" "Tomasz Kojm" "Clam AntiVirus"
2
+.TH "clamscan" "1" "March 1, 2005" "Tomasz Kojm" "Clam AntiVirus"
3 3
 .SH "NAME"
4 4
 .LP 
5 5
 clamscan \- scan files and directories against viruses
... ...
@@ -52,11 +52,11 @@ Sound bell on virus detection.
52 52
 \fB\-\-no\-summary\fR
53 53
 Do not display summary at the end of scanning.
54 54
 .TP 
55
-\fB\-\-exclude=PATT\fR
56
-Don't scan file names containing PATT. It may be used multiple times.
55
+\fB\-\-exclude=PATT, \-\-exclude\-dir=PATT\fR
56
+Don't scan file/directory names containing PATT. It may be used multiple times.
57 57
 .TP 
58
-\fB\-\-include=PATT\fR
59
-Only scan file names containing PATT. It may be used multiple times.
58
+\fB\-\-include=PATT, \-\-include\-dir=PATT\fR
59
+Only scan file/directory names containing PATT. It may be used multiple times.
60 60
 .TP 
61 61
 \fB\-i, \-\-infected\fR
62 62
 Only print infected files.