Browse code

update

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

Tomasz Kojm authored on 2004/09/19 04:26:08
Showing 12 changed files
... ...
@@ -1,3 +1,9 @@
1
+Sat Sep 18 21:23:00 CEST 2004 (tk)
2
+----------------------------------
3
+  * clamd: remove obsolete StreamSaveToDisk directive
4
+  * sigtool: add --html-normalise
5
+  * cleanup
6
+
1 7
 Sat Sep 18 16:02:32 BST 2004 (njh)
2 8
 ----------------------------------
3 9
   * libclamav:	Some minor code tidies
... ...
@@ -314,7 +314,7 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
314 314
 
315 315
 	if(cfgopt(copt, "ArchiveBlockEncrypted")) {
316 316
 	    logg("Archive: Blocking encrypted archives.\n");
317
-	    options |= CL_SCAN_ENCRYPTED;
317
+	    options |= CL_SCAN_BLOCKENCRYPTED;
318 318
 	}
319 319
 
320 320
 	if(cfgopt(copt, "ArchiveBlockMax")) {
... ...
@@ -171,7 +171,7 @@ int scanmanager(const struct optstruct *opt)
171 171
 	options |= CL_SCAN_BROKEN;
172 172
 
173 173
     if(optl(opt, "block-encrypted"))
174
-	options |= CL_SCAN_ENCRYPTED;
174
+	options |= CL_SCAN_BLOCKENCRYPTED;
175 175
 
176 176
     if(optl(opt, "block-max"))
177 177
 	options |= CL_SCAN_BLOCKMAX;
... ...
@@ -15,5 +15,5 @@
15 15
 #  along with this program; if not, write to the Free Software
16 16
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 17
 
18
-EXTRA_DIST = clamdoc.pdf DMS German Spanish Japanese html man FreeBSD-HowTo Portugese Turkish clamd_supervised clamav-mirror-howto.pdf signatures.pdf French Polish
18
+EXTRA_DIST = clamdoc.pdf html man clamav-mirror-howto.pdf signatures.pdf Polish
19 19
 man_MANS = man/clamscan.1 man/freshclam.1 man/sigtool.1 man/clamd.8 man/clamav.conf.5 man/clamdscan.1 man/clamav-milter.8 man/freshclam.conf.5
... ...
@@ -179,7 +179,7 @@ target_alias = @target_alias@
179 179
 target_cpu = @target_cpu@
180 180
 target_os = @target_os@
181 181
 target_vendor = @target_vendor@
182
-EXTRA_DIST = clamdoc.pdf DMS German Spanish Japanese html man FreeBSD-HowTo Portugese Turkish clamd_supervised clamav-mirror-howto.pdf signatures.pdf French Polish
182
+EXTRA_DIST = clamdoc.pdf html man clamav-mirror-howto.pdf signatures.pdf Polish
183 183
 man_MANS = man/clamscan.1 man/freshclam.1 man/sigtool.1 man/clamd.8 man/clamav.conf.5 man/clamdscan.1 man/clamav-milter.8 man/freshclam.conf.5
184 184
 all: all-am
185 185
 
... ...
@@ -1,5 +1,5 @@
1 1
 .\" Manual page created by Tomasz Kojm, 20020629
2
-.TH "sigtool" "1" "August 31, 2004" "Tomasz Kojm" "Clam AntiVirus"
2
+.TH "sigtool" "1" "September 18, 2004" "Tomasz Kojm" "Clam AntiVirus"
3 3
 .SH "NAME"
4 4
 .LP 
5 5
 sigtool \- signature and database management tool
... ...
@@ -9,7 +9,7 @@ sigtool [options]
9 9
 .SH "DESCRIPTION"
10 10
 .LP 
11 11
 sigtool can be used to generate MD5 checksums, convert data 
12
-into hexadecimal format, and build/unpack CVD databases. Also it can verify digital signatures of databases and list virus signature names.
12
+into hexadecimal format, and build/unpack CVD databases. It's  also to verify digital signatures of databases and list virus signature names.
13 13
 .SH "OPTIONS"
14 14
 .LP 
15 15
 
... ...
@@ -32,6 +32,9 @@ Read data from stdin and write hex string to stdout.
32 32
 \fB\-\-md5 [FILES]\fR
33 33
 Generate MD5 checksum from stdin or MD5 sigs for FILES.
34 34
 .TP 
35
+\fB\-\-html\-normalise=FILE\fR
36
+Create normalised HTML files comment.html, nocomment.html, and script.html in current working directory.
37
+.TP 
35 38
 \fB\-i, \-\-info\fR
36 39
 Print a CVD information and verify MD5 and a digital signature.
37 40
 .TP 
... ...
@@ -65,7 +65,7 @@ Example
65 65
 LocalSocket /tmp/clamd
66 66
 
67 67
 # Remove stale socket after unclean shutdown.
68
-#FixStaleSocket
68
+FixStaleSocket
69 69
 
70 70
 # TCP port address.
71 71
 #TCPSocket 3310
... ...
@@ -80,10 +80,6 @@ LocalSocket /tmp/clamd
80 80
 # Default is 15.
81 81
 #MaxConnectionQueueLength 30
82 82
 
83
-# When activated, input stream (see STREAM command) will be saved to disk before
84
-# scanning - this allows scanning within archives.
85
-#StreamSaveToDisk
86
-
87 83
 # Close the connection if this limit is exceeded.
88 84
 #StreamMaxLength 10M
89 85
 
... ...
@@ -69,7 +69,7 @@ extern "C"
69 69
 #define CL_SCAN_MAIL		2
70 70
 #define CL_SCAN_DISABLERAR	4
71 71
 #define CL_SCAN_OLE2		8
72
-#define CL_SCAN_ENCRYPTED	16
72
+#define CL_SCAN_BLOCKENCRYPTED	16
73 73
 #define CL_SCAN_HTML		32
74 74
 #define CL_SCAN_PE		64
75 75
 #define CL_SCAN_BROKEN		128
... ...
@@ -82,7 +82,7 @@ extern int cli_mbox(const char *dir, int desc, unsigned int options); /* FIXME *
82 82
 #define SCAN_HTML	    (options & CL_SCAN_HTML)
83 83
 #define SCAN_PE		    (options & CL_SCAN_PE)
84 84
 #define DISABLE_RAR	    (options & CL_SCAN_DISABLERAR)
85
-#define DETECT_ENCRYPTED    (options & CL_SCAN_ENCRYPTED)
85
+#define DETECT_ENCRYPTED    (options & CL_SCAN_BLOCKENCRYPTED)
86 86
 #define BLOCKMAX	    (options & CL_SCAN_BLOCKMAX)
87 87
 
88 88
 #define MAX_MAIL_RECURSION  15
... ...
@@ -1108,14 +1108,17 @@ static int cli_scanmail(int desc, const char **virname, long int *scanned, const
1108 1108
 	dir = cli_gentemp(tmpdir);
1109 1109
 	if(mkdir(dir, 0700)) {
1110 1110
 	    cli_dbgmsg("Mail: Can't create temporary directory %s\n", dir);
1111
+	    free(dir);
1111 1112
 	    return CL_ETMPDIR;
1112 1113
 	}
1113 1114
 
1114 1115
 	/*
1115 1116
 	 * Extract the attachments into the temporary directory
1116 1117
 	 */
1117
-	if((ret = cli_mbox(dir, desc, options)))
1118
+	if((ret = cli_mbox(dir, desc, options))) {
1119
+	    free(dir);
1118 1120
 	    return ret;
1121
+	}
1119 1122
 
1120 1123
 	ret = cli_scandir(dir, virname, scanned, root, limits, options, arec, mrec);
1121 1124
 
... ...
@@ -83,7 +83,6 @@ struct cfgstruct *parsecfg(const char *cfgfile, int messages)
83 83
 	    {"TCPSocket", OPT_NUM},
84 84
 	    {"LocalSocket", OPT_STR},
85 85
 	    {"MaxConnectionQueueLength", OPT_NUM},
86
-	    {"StreamSaveToDisk", OPT_NOARG},
87 86
 	    {"StreamMaxLength", OPT_COMPSIZE},
88 87
 	    {"MaxThreads", OPT_NUM},
89 88
 	    {"ReadTimeout", OPT_NUM},
... ...
@@ -51,6 +51,7 @@ int main(int argc, char **argv)
51 51
 	    {"tempdir", 1, 0, 0},
52 52
 	    {"hex-dump", 0, 0, 0},
53 53
 	    {"md5", 0, 0, 0},
54
+	    {"html-normalise", 1, 0, 0},
54 55
 	    {"build", 1, 0, 'b'},
55 56
 	    {"server", 1, 0, 0},
56 57
 	    {"unpack", 1, 0, 'u'},
... ...
@@ -29,6 +29,8 @@
29 29
 #include <time.h>
30 30
 #include <locale.h>
31 31
 #include <sys/types.h>
32
+#include <sys/stat.h>
33
+#include <fcntl.h>
32 34
 #include <sys/socket.h>
33 35
 #include <sys/un.h>
34 36
 #include <netinet/in.h>
... ...
@@ -128,6 +130,18 @@ void sigtool(struct optstruct *opt)
128 128
 	    free(md5);
129 129
 	}
130 130
 
131
+    } else if(optl(opt, "html-normalise")) {
132
+	    int fd;
133
+
134
+	if((fd = open(getargl(opt, "html-normalise"), O_RDONLY)) == -1) {
135
+	    mprintf("Can't open file %s\n", getargl(opt, "html-normalise"));
136
+	    exit(1);
137
+	}
138
+
139
+	html_normalise_fd(fd, ".", NULL);
140
+
141
+	close(fd);
142
+
131 143
     } else if(optc(opt, 'b')) {
132 144
 	if(!optl(opt, "server")) {
133 145
 	    mprintf("!--server is required in this mode\n");
... ...
@@ -785,6 +799,7 @@ void help(void)
785 785
     mprintf("                                           string and print it on stdout\n");
786 786
     mprintf("    --md5 [FILES]                          generate MD5 checksum from stdin\n");
787 787
     mprintf("                                           or MD5 sigs for FILES\n");
788
+    mprintf("    --html-normalise=FILE                  create normalised parts of HTML file\n");
788 789
     mprintf("    --info=FILE            -i FILE         print database information\n");
789 790
     mprintf("    --build=NAME           -b NAME         build a CVD file\n");
790 791
     mprintf("    --server=ADDR                          ClamAV Signing Service address\n");