Browse code

merge backport fixes for 0.85.1

git-svn-id: file:///var/lib/svn/clamav-devel/branches/0.88-stable@2779 77e5149b-7576-45b1-b177-96237e5ba77b

Sven Strickroth authored on 2007/02/18 23:24:34
Showing 11 changed files
... ...
@@ -1,3 +1,18 @@
1
+Mon May 16 23:22:55 CEST 2005
2
+-----------------------------
3
+  V 0.85.1
4
+  * Fixes backported from CVS:
5
+    - freshclam/manager.c: Removed superfluous close(hostfd), thanks to Pavel V.
6
+      Rochnyack <rpv*fsf.tsu.ru> (tk)
7
+    - libclamav/message.c: Fixed a problem where an email with more than one
8
+      content-disposition type line, one or more of which was empty, could
9
+      crash libclamav. Reported by Daniel Theodoro <dtheodoro at ig.com.br>
10
+      (njh)
11
+    - libclamav/special.c: Fix reading PString type in Photoshop thumbnails.
12
+      (trog)
13
+    - clamav-milter: Open /dev/console (if LogFile not set) before dropping
14
+      priv so that error messages aren't lost reported by David Crow. (njh)
15
+
1 16
 Wed May 11 17:48:27 CEST 2005
2 17
 -----------------------------
3 18
   V 0.85
... ...
@@ -1,8 +1,9 @@
1
-0.85
1
+0.85.1
2
+------
2 3
 
3
-Bugfixes in this release include correct signature offset calculation in large
4
-files, proper handling of encrypted zip archives, and others.
4
+A problem where an email with more than one content-disposition type line,
5
+one or more of which was empty, could crash libclamav has been fixed. Other
6
+minor bugfixes have been made.
5 7
 
6 8
 --
7 9
 The ClamAV team (http://www.clamav.net/team.html)
... ...
@@ -2,6 +2,16 @@ Note: This README/NEWS file refers to the source tarball. Some things described
2 2
 here may not be available in binary packages.
3 3
 --
4 4
 
5
+0.85.1
6
+------
7
+
8
+A problem where an email with more than one content-disposition type line,
9
+one or more of which was empty, could crash libclamav has been fixed. Other
10
+minor bugfixes have been made.
11
+
12
+--
13
+The ClamAV team (http://www.clamav.net/team.html)
14
+
5 15
 0.85
6 16
 ----
7 17
 
... ...
@@ -22,7 +22,7 @@
22 22
  *
23 23
  * For installation instructions see the file INSTALL that came with this file
24 24
  */
25
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.199 2005/05/11 12:26:44 nigelhorne Exp $";
25
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.200 2005/05/12 07:31:09 nigelhorne Exp $";
26 26
 
27 27
 #define	CM_VERSION	"0.85"
28 28
 
... ...
@@ -106,6 +106,7 @@ int	deny_severity = LOG_NOTICE;
106 106
 #ifndef	CL_DEBUG
107 107
 static	const	char	*logFile;
108 108
 static	int	logTime;
109
+static	char	console[] = "/dev/console";
109 110
 #endif
110 111
 
111 112
 #if defined(CL_DEBUG) && defined(C_LINUX)
... ...
@@ -511,6 +512,9 @@ main(int argc, char **argv)
511 511
 	const struct cfgstruct *cpt;
512 512
 	char version[VERSION_LENGTH + 1];
513 513
 	pthread_t tid;
514
+#ifndef	CL_DEBUG
515
+	int consolefd;
516
+#endif
514 517
 	struct smfiDesc smfilter = {
515 518
 		"ClamAv", /* filter name */
516 519
 		SMFI_VERSION,	/* version code -- leave untouched */
... ...
@@ -884,6 +888,11 @@ main(int argc, char **argv)
884 884
 	/*
885 885
 	 * Drop privileges
886 886
 	 */
887
+#ifndef	CL_DEBUG
888
+	/* Save the fd for later, open while we can */
889
+	consolefd = open(console, O_WRONLY);
890
+#endif
891
+
887 892
 	if(getuid() == 0) {
888 893
 		if(iface) {
889 894
 #ifdef	SO_BINDTODEVICE
... ...
@@ -1352,15 +1361,18 @@ main(int argc, char **argv)
1352 1352
 				return EX_CANTCREAT;
1353 1353
 			}
1354 1354
 		} else {
1355
-			logFile = "/dev/console";
1356
-			if(open(logFile, O_WRONLY) < 0) {
1357
-				perror(logFile);
1355
+			logFile = console;
1356
+			if(consolefd < 0) {
1357
+				perror(console);
1358 1358
 				return EX_OSFILE;
1359 1359
 			}
1360
+			dup(consolefd);
1360 1361
 		}
1361
-
1362 1362
 		close(2);
1363 1363
 		dup(1);
1364
+		if(consolefd >= 0)
1365
+			close(consolefd);
1366
+
1364 1367
 		if(cfgopt(copt, "LogTime"))
1365 1368
 			logTime++;
1366 1369
 #endif	/*!CL_DEBUG*/
... ...
@@ -200,7 +200,7 @@ int scanmanager(const struct optstruct *opt)
200 200
     }
201 201
 
202 202
 #ifdef C_LINUX
203
-    procdev = 0;
203
+    procdev = (dev_t) 0;
204 204
     if(stat("/proc", &sb) != -1 && !sb.st_size)
205 205
 	procdev = sb.st_dev;
206 206
 #endif
... ...
@@ -2072,7 +2072,7 @@ fi
2072 2072
 
2073 2073
 # Define the identity of the package.
2074 2074
  PACKAGE=clamav
2075
- VERSION="0.85"
2075
+ VERSION="0.85.1"
2076 2076
 
2077 2077
 
2078 2078
 cat >>confdefs.h <<_ACEOF
... ...
@@ -2206,7 +2206,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
2206 2206
 
2207 2207
 
2208 2208
 LC_CURRENT=1
2209
-LC_REVISION=11
2209
+LC_REVISION=12
2210 2210
 LC_AGE=0
2211 2211
 LIBCLAMAV_VERSION="$LC_CURRENT":"$LC_REVISION":"$LC_AGE"
2212 2212
 
... ...
@@ -18,11 +18,11 @@ dnl   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 18
 
19 19
 AC_INIT(clamscan/clamscan.c)
20 20
 AC_CREATE_TARGET_H(target.h)
21
-AM_INIT_AUTOMAKE(clamav, "0.85")
21
+AM_INIT_AUTOMAKE(clamav, "0.85.1")
22 22
 AM_CONFIG_HEADER(clamav-config.h)
23 23
 
24 24
 LC_CURRENT=1
25
-LC_REVISION=11
25
+LC_REVISION=12
26 26
 LC_AGE=0
27 27
 LIBCLAMAV_VERSION="$LC_CURRENT":"$LC_REVISION":"$LC_AGE"
28 28
 AC_SUBST(LIBCLAMAV_VERSION)
... ...
@@ -346,7 +346,6 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
346 346
 	}
347 347
 
348 348
 	*signo += current->sigs;
349
-	close(hostfd);
350 349
 	cl_cvdfree(current);
351 350
 	return 1;
352 351
     }
... ...
@@ -359,11 +359,13 @@ messageSetDispositionType(message *m, const char *disptype)
359 359
 	 */
360 360
 	while(*disptype && isspace((int)*disptype))
361 361
 		disptype++;
362
+
362 363
 	if(*disptype) {
363 364
 		m->mimeDispositionType = strdup(disptype);
364 365
 		if(m->mimeDispositionType)
365 366
 			strstrip(m->mimeDispositionType);
366
-	}
367
+	} else
368
+		m->mimeDispositionType = NULL;
367 369
 }
368 370
 
369 371
 const char *
... ...
@@ -93,7 +93,8 @@ int cli_check_mydoom_log(int desc, const char **virname)
93 93
 static int jpeg_check_photoshop_8bim(int fd)
94 94
 {
95 95
 	unsigned char bim[5];
96
-	uint16_t id, nlength;
96
+	uint16_t id, ntmp;
97
+	uint8_t nlength;
97 98
 	uint32_t size;
98 99
 	off_t offset;
99 100
 	int retval;
... ...
@@ -114,15 +115,12 @@ static int jpeg_check_photoshop_8bim(int fd)
114 114
 	}
115 115
 	id = special_endian_convert_16(id);
116 116
 	cli_dbgmsg("ID: 0x%.4x\n", id);
117
-	if (cli_readn(fd, &nlength, 2) != 2) {
117
+	if (cli_readn(fd, &nlength, 1) != 1) {
118 118
 		return -1;
119 119
 	}
120
-	nlength = special_endian_convert_16(nlength);
121
-	/* Seek past the name string */
122
-	if (nlength > 0) {
123
-		lseek(fd, nlength, SEEK_CUR);
124
-	}
125
-
120
+	ntmp = nlength + ((((uint16_t)nlength)+1) & 0x01);
121
+	lseek(fd, ntmp, SEEK_CUR);
122
+	
126 123
 	if (cli_readn(fd, &size, 4) != 4) {
127 124
 		return -1;
128 125
 	}
... ...
@@ -24,7 +24,7 @@
24 24
 #include "clamav-config.h"
25 25
 #endif
26 26
 
27
-static	char	const	rcsid[] = "$Id: tnef.c,v 1.19 2005/05/04 21:41:18 nigelhorne Exp $";
27
+static	char	const	rcsid[] = "$Id: tnef.c,v 1.22 2005/05/12 12:39:57 nigelhorne Exp $";
28 28
 
29 29
 #include <stdio.h>
30 30
 #include <fcntl.h>
... ...
@@ -51,6 +51,7 @@ static	int	tnef_header(FILE *fp, uint8_t *part, uint16_t *type, uint16_t *tag, u
51 51
 #define	attATTACHDATA	0x800f	/* Attachment Data */
52 52
 #define	attATTACHTITLE	0x8010	/* Attachment File Name */
53 53
 #define	attDATEMODIFIED	0x8020
54
+#define	attTNEFVERSION	0x9006
54 55
 #define	attOEMCODEPAGE	0x9007
55 56
 
56 57
 #if WORDS_BIGENDIAN == 0
... ...
@@ -198,6 +199,7 @@ tnef_message(FILE *fp, uint16_t type, uint16_t tag, uint32_t length)
198 198
 	uint16_t i16;
199 199
 	off_t offset;
200 200
 #if	CL_DEBUG
201
+	uint32_t i32;
201 202
 	char *string;
202 203
 #endif
203 204
 
... ...
@@ -210,7 +212,7 @@ tnef_message(FILE *fp, uint16_t type, uint16_t tag, uint32_t length)
210 210
 	 */
211 211
 	switch(tag) {
212 212
 		case attBODY:
213
-			cli_warnmsg("TNEF body not being scanned - report to bugs@clamav.net\n");
213
+			cli_warnmsg("TNEF body not being scanned - if you believe this file contains a virus, submit it to www.clamav.net\n");
214 214
 			break;
215 215
 #if	CL_DEBUG
216 216
 		case attTNEFVERSION: