git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@587 77e5149b-7576-45b1-b177-96237e5ba77b
Tomasz Kojm authored on 2004/06/02 09:36:05... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
Tomasz Kojm <tkojm*clamav.net> |
2 |
-home page : http://www.konarski.edu.pl/~zolw |
|
2 |
+home page : http://www.mat.uni.torun.pl/~tk |
|
3 | 3 |
gpg key : http://www.clamav.net/gpg/tkojm.gpg |
4 | 4 |
GPG fingerprint = 0DCA 5A08 407D 5288 279D B434 5482 2DC8 985A 444B |
5 | 5 |
Project leader. |
... | ... |
@@ -56,6 +56,7 @@ TrashScan was written by Trashware <trashware*gmx.net>. |
56 | 56 |
libclamav/zziplib: Guido Draheim <guidod*gmx.de> |
57 | 57 |
libclamav/unrarlib.c: Christian Scheurer and Johannes Winkelmann, see |
58 | 58 |
www.unrarlib.org |
59 |
+libclamav/mspack: Stuart Caie |
|
59 | 60 |
|
60 | 61 |
ClamAV patches were submitted by (in alphabetical order): |
61 | 62 |
|
... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Wed Jun 2 02:30:34 CEST 2004 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav: support MS cabinet files (test/test.cab). Based on libmspack. |
|
4 |
+ |
|
1 | 5 |
Tue Jun 1 10:09:02 BST 2004 (njh) |
2 | 6 |
---------------------------------- |
3 | 7 |
* libclamav/message.c: Corrupted BinHex could still cause crash on |
... | ... |
@@ -12,7 +12,7 @@ the noteworthy changes include: |
12 | 12 |
+ support nested OLE2 files |
13 | 13 |
+ support Word6 macro code |
14 | 14 |
+ ignore popular file types (media, graphics) |
15 |
- + support compress.exe (SZDD) compression (test/test1.msc) |
|
15 |
+ + support compress.exe (SZDD) compression (test/test.msc) |
|
16 | 16 |
+ improve virus detection in e-mails |
17 | 17 |
|
18 | 18 |
-) clamscan: |
... | ... |
@@ -81,7 +81,7 @@ dnl there is now a CREATE_PREFIX_TARGET_H in this file as a shorthand for |
81 | 81 |
dnl PREFIX_CONFIG_H from a target.h file, however w/o the target.h ever created |
82 | 82 |
dnl (the prefix is a bit different, since we add an extra -target- and -host-) |
83 | 83 |
dnl |
84 |
-dnl @version: $Id: aclocal.m4,v 1.38 2004/05/25 20:38:23 kojm Exp $ |
|
84 |
+dnl @version: $Id: aclocal.m4,v 1.39 2004/06/02 00:36:04 kojm Exp $ |
|
85 | 85 |
dnl @author Guido Draheim <guidod@gmx.de> STATUS: used often |
86 | 86 |
|
87 | 87 |
AC_DEFUN([AC_CREATE_TARGET_H], |
... | ... |
@@ -4041,7 +4041,7 @@ dnl AC_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers) |
4041 | 4041 |
dnl AC_COMPILE_CHECK_SIZEOF(off_t, $headers) |
4042 | 4042 |
dnl |
4043 | 4043 |
dnl @author Kaveh Ghazi <ghazi@caip.rutgers.edu> |
4044 |
-dnl @version $Id: aclocal.m4,v 1.38 2004/05/25 20:38:23 kojm Exp $ |
|
4044 |
+dnl @version $Id: aclocal.m4,v 1.39 2004/06/02 00:36:04 kojm Exp $ |
|
4045 | 4045 |
dnl |
4046 | 4046 |
AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], |
4047 | 4047 |
[changequote(<<, >>)dnl |
... | ... |
@@ -78,6 +78,9 @@ |
78 | 78 |
/* Define to 1 if you have the <dlfcn.h> header file. */ |
79 | 79 |
#undef HAVE_DLFCN_H |
80 | 80 |
|
81 |
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ |
|
82 |
+#undef HAVE_FSEEKO |
|
83 |
+ |
|
81 | 84 |
/* Define to 1 if you have the `getpagesize' function. */ |
82 | 85 |
#undef HAVE_GETPAGESIZE |
83 | 86 |
|
... | ... |
@@ -93,6 +96,9 @@ |
93 | 93 |
/* in_port_t is defined */ |
94 | 94 |
#undef HAVE_IN_PORT_T |
95 | 95 |
|
96 |
+/* Define to 1 if you have the <limits.h> header file. */ |
|
97 |
+#undef HAVE_LIMITS_H |
|
98 |
+ |
|
96 | 99 |
/* Define to 1 if you have the <malloc.h> header file. */ |
97 | 100 |
#undef HAVE_MALLOC_H |
98 | 101 |
|
... | ... |
@@ -234,6 +240,9 @@ |
234 | 234 |
/* endianess */ |
235 | 235 |
#undef WORDS_BIGENDIAN |
236 | 236 |
|
237 |
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ |
|
238 |
+#undef _LARGEFILE_SOURCE |
|
239 |
+ |
|
237 | 240 |
/* thread safe */ |
238 | 241 |
#undef _REENTRANT |
239 | 242 |
|
... | ... |
@@ -7862,7 +7862,8 @@ fi |
7862 | 7862 |
|
7863 | 7863 |
|
7864 | 7864 |
|
7865 |
-for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h regex.h |
|
7865 |
+ |
|
7866 |
+for ac_header in stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h regex.h limits.h |
|
7866 | 7867 |
do |
7867 | 7868 |
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` |
7868 | 7869 |
if eval "test \"\${$as_ac_Header+set}\" = set"; then |
... | ... |
@@ -8668,6 +8669,156 @@ _ACEOF |
8668 | 8668 |
fi |
8669 | 8669 |
rm -f conftest.mmap |
8670 | 8670 |
|
8671 |
+echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 |
|
8672 |
+echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 |
|
8673 |
+if test "${ac_cv_sys_largefile_source+set}" = set; then |
|
8674 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6 |
|
8675 |
+else |
|
8676 |
+ while :; do |
|
8677 |
+ ac_cv_sys_largefile_source=no |
|
8678 |
+ cat >conftest.$ac_ext <<_ACEOF |
|
8679 |
+#line $LINENO "configure" |
|
8680 |
+#include "confdefs.h" |
|
8681 |
+#include <stdio.h> |
|
8682 |
+#ifdef F77_DUMMY_MAIN |
|
8683 |
+# ifdef __cplusplus |
|
8684 |
+ extern "C" |
|
8685 |
+# endif |
|
8686 |
+ int F77_DUMMY_MAIN() { return 1; } |
|
8687 |
+#endif |
|
8688 |
+int |
|
8689 |
+main () |
|
8690 |
+{ |
|
8691 |
+return !fseeko; |
|
8692 |
+ ; |
|
8693 |
+ return 0; |
|
8694 |
+} |
|
8695 |
+_ACEOF |
|
8696 |
+rm -f conftest.$ac_objext |
|
8697 |
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
|
8698 |
+ (eval $ac_compile) 2>&5 |
|
8699 |
+ ac_status=$? |
|
8700 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
|
8701 |
+ (exit $ac_status); } && |
|
8702 |
+ { ac_try='test -s conftest.$ac_objext' |
|
8703 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
|
8704 |
+ (eval $ac_try) 2>&5 |
|
8705 |
+ ac_status=$? |
|
8706 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
|
8707 |
+ (exit $ac_status); }; }; then |
|
8708 |
+ break |
|
8709 |
+else |
|
8710 |
+ echo "$as_me: failed program was:" >&5 |
|
8711 |
+cat conftest.$ac_ext >&5 |
|
8712 |
+fi |
|
8713 |
+rm -f conftest.$ac_objext conftest.$ac_ext |
|
8714 |
+ cat >conftest.$ac_ext <<_ACEOF |
|
8715 |
+#line $LINENO "configure" |
|
8716 |
+#include "confdefs.h" |
|
8717 |
+#define _LARGEFILE_SOURCE 1 |
|
8718 |
+#include <stdio.h> |
|
8719 |
+#ifdef F77_DUMMY_MAIN |
|
8720 |
+# ifdef __cplusplus |
|
8721 |
+ extern "C" |
|
8722 |
+# endif |
|
8723 |
+ int F77_DUMMY_MAIN() { return 1; } |
|
8724 |
+#endif |
|
8725 |
+int |
|
8726 |
+main () |
|
8727 |
+{ |
|
8728 |
+return !fseeko; |
|
8729 |
+ ; |
|
8730 |
+ return 0; |
|
8731 |
+} |
|
8732 |
+_ACEOF |
|
8733 |
+rm -f conftest.$ac_objext |
|
8734 |
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
|
8735 |
+ (eval $ac_compile) 2>&5 |
|
8736 |
+ ac_status=$? |
|
8737 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
|
8738 |
+ (exit $ac_status); } && |
|
8739 |
+ { ac_try='test -s conftest.$ac_objext' |
|
8740 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
|
8741 |
+ (eval $ac_try) 2>&5 |
|
8742 |
+ ac_status=$? |
|
8743 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
|
8744 |
+ (exit $ac_status); }; }; then |
|
8745 |
+ ac_cv_sys_largefile_source=1; break |
|
8746 |
+else |
|
8747 |
+ echo "$as_me: failed program was:" >&5 |
|
8748 |
+cat conftest.$ac_ext >&5 |
|
8749 |
+fi |
|
8750 |
+rm -f conftest.$ac_objext conftest.$ac_ext |
|
8751 |
+ break |
|
8752 |
+done |
|
8753 |
+fi |
|
8754 |
+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 |
|
8755 |
+echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 |
|
8756 |
+if test "$ac_cv_sys_largefile_source" != no; then |
|
8757 |
+ |
|
8758 |
+cat >>confdefs.h <<_ACEOF |
|
8759 |
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source |
|
8760 |
+_ACEOF |
|
8761 |
+ |
|
8762 |
+fi |
|
8763 |
+rm -f conftest* |
|
8764 |
+ |
|
8765 |
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug |
|
8766 |
+# in glibc 2.1.3, but that breaks too many other things. |
|
8767 |
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. |
|
8768 |
+echo "$as_me:$LINENO: checking for fseeko" >&5 |
|
8769 |
+echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 |
|
8770 |
+if test "${ac_cv_func_fseeko+set}" = set; then |
|
8771 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6 |
|
8772 |
+else |
|
8773 |
+ cat >conftest.$ac_ext <<_ACEOF |
|
8774 |
+#line $LINENO "configure" |
|
8775 |
+#include "confdefs.h" |
|
8776 |
+#include <stdio.h> |
|
8777 |
+#ifdef F77_DUMMY_MAIN |
|
8778 |
+# ifdef __cplusplus |
|
8779 |
+ extern "C" |
|
8780 |
+# endif |
|
8781 |
+ int F77_DUMMY_MAIN() { return 1; } |
|
8782 |
+#endif |
|
8783 |
+int |
|
8784 |
+main () |
|
8785 |
+{ |
|
8786 |
+return fseeko && fseeko (stdin, 0, 0); |
|
8787 |
+ ; |
|
8788 |
+ return 0; |
|
8789 |
+} |
|
8790 |
+_ACEOF |
|
8791 |
+rm -f conftest.$ac_objext conftest$ac_exeext |
|
8792 |
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 |
|
8793 |
+ (eval $ac_link) 2>&5 |
|
8794 |
+ ac_status=$? |
|
8795 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
|
8796 |
+ (exit $ac_status); } && |
|
8797 |
+ { ac_try='test -s conftest$ac_exeext' |
|
8798 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 |
|
8799 |
+ (eval $ac_try) 2>&5 |
|
8800 |
+ ac_status=$? |
|
8801 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 |
|
8802 |
+ (exit $ac_status); }; }; then |
|
8803 |
+ ac_cv_func_fseeko=yes |
|
8804 |
+else |
|
8805 |
+ echo "$as_me: failed program was:" >&5 |
|
8806 |
+cat conftest.$ac_ext >&5 |
|
8807 |
+ac_cv_func_fseeko=no |
|
8808 |
+fi |
|
8809 |
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext |
|
8810 |
+fi |
|
8811 |
+echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5 |
|
8812 |
+echo "${ECHO_T}$ac_cv_func_fseeko" >&6 |
|
8813 |
+if test $ac_cv_func_fseeko = yes; then |
|
8814 |
+ |
|
8815 |
+cat >>confdefs.h <<\_ACEOF |
|
8816 |
+#define HAVE_FSEEKO 1 |
|
8817 |
+_ACEOF |
|
8818 |
+ |
|
8819 |
+fi |
|
8820 |
+ |
|
8671 | 8821 |
|
8672 | 8822 |
# Check for broken snprintf |
8673 | 8823 |
if test "x$ac_cv_func_snprintf" = "xyes" ; then |
... | ... |
@@ -37,13 +37,14 @@ AC_DEFINE(SCANBUFF, 131072, [scan buffer size]) |
37 | 37 |
AC_DEFINE(FILEBUFF, 8192, [file i/o buffer size]) |
38 | 38 |
|
39 | 39 |
AC_HEADER_STDC |
40 |
-AC_CHECK_HEADERS(stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h regex.h) |
|
40 |
+AC_CHECK_HEADERS(stdint.h unistd.h sys/int_types.h dlfcn.h inttypes.h sys/inttypes.h memory.h ndir.h stdlib.h strings.h string.h sys/mman.h sys/param.h sys/stat.h sys/types.h malloc.h poll.h regex.h limits.h) |
|
41 | 41 |
AC_TYPE_OFF_T |
42 | 42 |
AC_COMPILE_CHECK_SIZEOF(short) |
43 | 43 |
AC_COMPILE_CHECK_SIZEOF(int) |
44 | 44 |
AC_COMPILE_CHECK_SIZEOF(long) |
45 | 45 |
AC_CHECK_FUNCS(poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat inet_ntop) |
46 | 46 |
AC_FUNC_MMAP |
47 |
+AC_FUNC_FSEEKO |
|
47 | 48 |
|
48 | 49 |
# Check for broken snprintf |
49 | 50 |
if test "x$ac_cv_func_snprintf" = "xyes" ; then |
... | ... |
@@ -16,7 +16,7 @@ |
16 | 16 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
17 | 17 |
|
18 | 18 |
|
19 |
-INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib |
|
19 |
+INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib -I@srcdir@/mspack |
|
20 | 20 |
|
21 | 21 |
libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ |
22 | 22 |
|
... | ... |
@@ -83,6 +83,17 @@ libclamav_la_SOURCES = \ |
83 | 83 |
msexpand.c \ |
84 | 84 |
msexpand.h \ |
85 | 85 |
pe.c \ |
86 |
- pe.h |
|
86 |
+ pe.h \ |
|
87 |
+ mspack/cabd.c \ |
|
88 |
+ mspack/cab.h \ |
|
89 |
+ mspack/lzxd.c \ |
|
90 |
+ mspack/lzx.h \ |
|
91 |
+ mspack/mspack.h \ |
|
92 |
+ mspack/mszipd.c \ |
|
93 |
+ mspack/mszip.h \ |
|
94 |
+ mspack/qtmd.c \ |
|
95 |
+ mspack/qtm.h \ |
|
96 |
+ mspack/system.c \ |
|
97 |
+ mspack/system.h |
|
87 | 98 |
|
88 | 99 |
lib_LTLIBRARIES = libclamav.la |
... | ... |
@@ -117,7 +117,7 @@ am__include = @am__include@ |
117 | 117 |
am__quote = @am__quote@ |
118 | 118 |
install_sh = @install_sh@ |
119 | 119 |
|
120 |
-INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib |
|
120 |
+INCLUDES = -I$(top_srcdir) -I@srcdir@/zziplib -I@srcdir@/mspack |
|
121 | 121 |
|
122 | 122 |
libclamav_la_LIBADD = @LIBCLAMAV_LIBS@ |
123 | 123 |
|
... | ... |
@@ -184,7 +184,18 @@ libclamav_la_SOURCES = \ |
184 | 184 |
msexpand.c \ |
185 | 185 |
msexpand.h \ |
186 | 186 |
pe.c \ |
187 |
- pe.h |
|
187 |
+ pe.h \ |
|
188 |
+ mspack/cabd.c \ |
|
189 |
+ mspack/cab.h \ |
|
190 |
+ mspack/lzxd.c \ |
|
191 |
+ mspack/lzx.h \ |
|
192 |
+ mspack/mspack.h \ |
|
193 |
+ mspack/mszipd.c \ |
|
194 |
+ mspack/mszip.h \ |
|
195 |
+ mspack/qtmd.c \ |
|
196 |
+ mspack/qtm.h \ |
|
197 |
+ mspack/system.c \ |
|
198 |
+ mspack/system.h |
|
188 | 199 |
|
189 | 200 |
|
190 | 201 |
lib_LTLIBRARIES = libclamav.la |
... | ... |
@@ -200,7 +211,7 @@ am_libclamav_la_OBJECTS = matcher.lo md5.lo others.lo readdb.lo cvd.lo \ |
200 | 200 |
zzip-file.lo zzip-info.lo zzip-io.lo zzip-stat.lo zzip-zip.lo \ |
201 | 201 |
strc.lo blob.lo mbox.lo message.lo snprintf.lo strrcpy.lo \ |
202 | 202 |
table.lo text.lo ole2_extract.lo vba_extract.lo msexpand.lo \ |
203 |
- pe.lo |
|
203 |
+ pe.lo cabd.lo lzxd.lo mszipd.lo qtmd.lo system.lo |
|
204 | 204 |
libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS) |
205 | 205 |
|
206 | 206 |
DEFS = @DEFS@ |
... | ... |
@@ -210,16 +221,19 @@ LDFLAGS = @LDFLAGS@ |
210 | 210 |
LIBS = @LIBS@ |
211 | 211 |
depcomp = $(SHELL) $(top_srcdir)/depcomp |
212 | 212 |
am__depfiles_maybe = depfiles |
213 |
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/blob.Plo ./$(DEPDIR)/cvd.Plo \ |
|
214 |
-@AMDEP_TRUE@ ./$(DEPDIR)/dsig.Plo ./$(DEPDIR)/matcher.Plo \ |
|
213 |
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/blob.Plo ./$(DEPDIR)/cabd.Plo \ |
|
214 |
+@AMDEP_TRUE@ ./$(DEPDIR)/cvd.Plo ./$(DEPDIR)/dsig.Plo \ |
|
215 |
+@AMDEP_TRUE@ ./$(DEPDIR)/lzxd.Plo ./$(DEPDIR)/matcher.Plo \ |
|
215 | 216 |
@AMDEP_TRUE@ ./$(DEPDIR)/mbox.Plo ./$(DEPDIR)/md5.Plo \ |
216 | 217 |
@AMDEP_TRUE@ ./$(DEPDIR)/message.Plo ./$(DEPDIR)/msexpand.Plo \ |
217 |
-@AMDEP_TRUE@ ./$(DEPDIR)/ole2_extract.Plo ./$(DEPDIR)/others.Plo \ |
|
218 |
-@AMDEP_TRUE@ ./$(DEPDIR)/pe.Plo ./$(DEPDIR)/readdb.Plo \ |
|
218 |
+@AMDEP_TRUE@ ./$(DEPDIR)/mszipd.Plo ./$(DEPDIR)/ole2_extract.Plo \ |
|
219 |
+@AMDEP_TRUE@ ./$(DEPDIR)/others.Plo ./$(DEPDIR)/pe.Plo \ |
|
220 |
+@AMDEP_TRUE@ ./$(DEPDIR)/qtmd.Plo ./$(DEPDIR)/readdb.Plo \ |
|
219 | 221 |
@AMDEP_TRUE@ ./$(DEPDIR)/scanners.Plo ./$(DEPDIR)/snprintf.Plo \ |
220 | 222 |
@AMDEP_TRUE@ ./$(DEPDIR)/str.Plo ./$(DEPDIR)/strc.Plo \ |
221 |
-@AMDEP_TRUE@ ./$(DEPDIR)/strrcpy.Plo ./$(DEPDIR)/table.Plo \ |
|
222 |
-@AMDEP_TRUE@ ./$(DEPDIR)/text.Plo ./$(DEPDIR)/unrarlib.Plo \ |
|
223 |
+@AMDEP_TRUE@ ./$(DEPDIR)/strrcpy.Plo ./$(DEPDIR)/system.Plo \ |
|
224 |
+@AMDEP_TRUE@ ./$(DEPDIR)/table.Plo ./$(DEPDIR)/text.Plo \ |
|
225 |
+@AMDEP_TRUE@ ./$(DEPDIR)/unrarlib.Plo \ |
|
223 | 226 |
@AMDEP_TRUE@ ./$(DEPDIR)/vba_extract.Plo \ |
224 | 227 |
@AMDEP_TRUE@ ./$(DEPDIR)/zzip-dir.Plo ./$(DEPDIR)/zzip-err.Plo \ |
225 | 228 |
@AMDEP_TRUE@ ./$(DEPDIR)/zzip-file.Plo ./$(DEPDIR)/zzip-info.Plo \ |
... | ... |
@@ -278,6 +292,11 @@ zzip-io.lo: zziplib/zzip-io.c |
278 | 278 |
zzip-stat.lo: zziplib/zzip-stat.c |
279 | 279 |
zzip-zip.lo: zziplib/zzip-zip.c |
280 | 280 |
strc.lo: zziplib/strc.c |
281 |
+cabd.lo: mspack/cabd.c |
|
282 |
+lzxd.lo: mspack/lzxd.c |
|
283 |
+mszipd.lo: mspack/mszipd.c |
|
284 |
+qtmd.lo: mspack/qtmd.c |
|
285 |
+system.lo: mspack/system.c |
|
281 | 286 |
libclamav.la: $(libclamav_la_OBJECTS) $(libclamav_la_DEPENDENCIES) |
282 | 287 |
$(LINK) -rpath $(libdir) $(libclamav_la_LDFLAGS) $(libclamav_la_OBJECTS) $(libclamav_la_LIBADD) $(LIBS) |
283 | 288 |
|
... | ... |
@@ -288,22 +307,27 @@ distclean-compile: |
288 | 288 |
-rm -f *.tab.c |
289 | 289 |
|
290 | 290 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blob.Plo@am__quote@ |
291 |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cabd.Plo@am__quote@ |
|
291 | 292 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvd.Plo@am__quote@ |
292 | 293 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dsig.Plo@am__quote@ |
294 |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzxd.Plo@am__quote@ |
|
293 | 295 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matcher.Plo@am__quote@ |
294 | 296 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbox.Plo@am__quote@ |
295 | 297 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@ |
296 | 298 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Plo@am__quote@ |
297 | 299 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msexpand.Plo@am__quote@ |
300 |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mszipd.Plo@am__quote@ |
|
298 | 301 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ole2_extract.Plo@am__quote@ |
299 | 302 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/others.Plo@am__quote@ |
300 | 303 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pe.Plo@am__quote@ |
304 |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qtmd.Plo@am__quote@ |
|
301 | 305 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdb.Plo@am__quote@ |
302 | 306 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanners.Plo@am__quote@ |
303 | 307 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@ |
304 | 308 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str.Plo@am__quote@ |
305 | 309 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strc.Plo@am__quote@ |
306 | 310 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strrcpy.Plo@am__quote@ |
311 |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/system.Plo@am__quote@ |
|
307 | 312 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table.Plo@am__quote@ |
308 | 313 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text.Plo@am__quote@ |
309 | 314 |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unrarlib.Plo@am__quote@ |
... | ... |
@@ -480,6 +504,96 @@ strc.lo: zziplib/strc.c |
480 | 480 |
@AMDEP_TRUE@ depfile='$(DEPDIR)/strc.Plo' tmpdepfile='$(DEPDIR)/strc.TPlo' @AMDEPBACKSLASH@ |
481 | 481 |
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
482 | 482 |
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strc.lo `test -f 'zziplib/strc.c' || echo '$(srcdir)/'`zziplib/strc.c |
483 |
+ |
|
484 |
+cabd.o: mspack/cabd.c |
|
485 |
+@AMDEP_TRUE@ source='mspack/cabd.c' object='cabd.o' libtool=no @AMDEPBACKSLASH@ |
|
486 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/cabd.Po' tmpdepfile='$(DEPDIR)/cabd.TPo' @AMDEPBACKSLASH@ |
|
487 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
488 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd.o `test -f 'mspack/cabd.c' || echo '$(srcdir)/'`mspack/cabd.c |
|
489 |
+ |
|
490 |
+cabd.obj: mspack/cabd.c |
|
491 |
+@AMDEP_TRUE@ source='mspack/cabd.c' object='cabd.obj' libtool=no @AMDEPBACKSLASH@ |
|
492 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/cabd.Po' tmpdepfile='$(DEPDIR)/cabd.TPo' @AMDEPBACKSLASH@ |
|
493 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
494 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd.obj `cygpath -w mspack/cabd.c` |
|
495 |
+ |
|
496 |
+cabd.lo: mspack/cabd.c |
|
497 |
+@AMDEP_TRUE@ source='mspack/cabd.c' object='cabd.lo' libtool=yes @AMDEPBACKSLASH@ |
|
498 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/cabd.Plo' tmpdepfile='$(DEPDIR)/cabd.TPlo' @AMDEPBACKSLASH@ |
|
499 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
500 |
+ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cabd.lo `test -f 'mspack/cabd.c' || echo '$(srcdir)/'`mspack/cabd.c |
|
501 |
+ |
|
502 |
+lzxd.o: mspack/lzxd.c |
|
503 |
+@AMDEP_TRUE@ source='mspack/lzxd.c' object='lzxd.o' libtool=no @AMDEPBACKSLASH@ |
|
504 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/lzxd.Po' tmpdepfile='$(DEPDIR)/lzxd.TPo' @AMDEPBACKSLASH@ |
|
505 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
506 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lzxd.o `test -f 'mspack/lzxd.c' || echo '$(srcdir)/'`mspack/lzxd.c |
|
507 |
+ |
|
508 |
+lzxd.obj: mspack/lzxd.c |
|
509 |
+@AMDEP_TRUE@ source='mspack/lzxd.c' object='lzxd.obj' libtool=no @AMDEPBACKSLASH@ |
|
510 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/lzxd.Po' tmpdepfile='$(DEPDIR)/lzxd.TPo' @AMDEPBACKSLASH@ |
|
511 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
512 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lzxd.obj `cygpath -w mspack/lzxd.c` |
|
513 |
+ |
|
514 |
+lzxd.lo: mspack/lzxd.c |
|
515 |
+@AMDEP_TRUE@ source='mspack/lzxd.c' object='lzxd.lo' libtool=yes @AMDEPBACKSLASH@ |
|
516 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/lzxd.Plo' tmpdepfile='$(DEPDIR)/lzxd.TPlo' @AMDEPBACKSLASH@ |
|
517 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
518 |
+ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lzxd.lo `test -f 'mspack/lzxd.c' || echo '$(srcdir)/'`mspack/lzxd.c |
|
519 |
+ |
|
520 |
+mszipd.o: mspack/mszipd.c |
|
521 |
+@AMDEP_TRUE@ source='mspack/mszipd.c' object='mszipd.o' libtool=no @AMDEPBACKSLASH@ |
|
522 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/mszipd.Po' tmpdepfile='$(DEPDIR)/mszipd.TPo' @AMDEPBACKSLASH@ |
|
523 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
524 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mszipd.o `test -f 'mspack/mszipd.c' || echo '$(srcdir)/'`mspack/mszipd.c |
|
525 |
+ |
|
526 |
+mszipd.obj: mspack/mszipd.c |
|
527 |
+@AMDEP_TRUE@ source='mspack/mszipd.c' object='mszipd.obj' libtool=no @AMDEPBACKSLASH@ |
|
528 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/mszipd.Po' tmpdepfile='$(DEPDIR)/mszipd.TPo' @AMDEPBACKSLASH@ |
|
529 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
530 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mszipd.obj `cygpath -w mspack/mszipd.c` |
|
531 |
+ |
|
532 |
+mszipd.lo: mspack/mszipd.c |
|
533 |
+@AMDEP_TRUE@ source='mspack/mszipd.c' object='mszipd.lo' libtool=yes @AMDEPBACKSLASH@ |
|
534 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/mszipd.Plo' tmpdepfile='$(DEPDIR)/mszipd.TPlo' @AMDEPBACKSLASH@ |
|
535 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
536 |
+ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mszipd.lo `test -f 'mspack/mszipd.c' || echo '$(srcdir)/'`mspack/mszipd.c |
|
537 |
+ |
|
538 |
+qtmd.o: mspack/qtmd.c |
|
539 |
+@AMDEP_TRUE@ source='mspack/qtmd.c' object='qtmd.o' libtool=no @AMDEPBACKSLASH@ |
|
540 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/qtmd.Po' tmpdepfile='$(DEPDIR)/qtmd.TPo' @AMDEPBACKSLASH@ |
|
541 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
542 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o qtmd.o `test -f 'mspack/qtmd.c' || echo '$(srcdir)/'`mspack/qtmd.c |
|
543 |
+ |
|
544 |
+qtmd.obj: mspack/qtmd.c |
|
545 |
+@AMDEP_TRUE@ source='mspack/qtmd.c' object='qtmd.obj' libtool=no @AMDEPBACKSLASH@ |
|
546 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/qtmd.Po' tmpdepfile='$(DEPDIR)/qtmd.TPo' @AMDEPBACKSLASH@ |
|
547 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
548 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o qtmd.obj `cygpath -w mspack/qtmd.c` |
|
549 |
+ |
|
550 |
+qtmd.lo: mspack/qtmd.c |
|
551 |
+@AMDEP_TRUE@ source='mspack/qtmd.c' object='qtmd.lo' libtool=yes @AMDEPBACKSLASH@ |
|
552 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/qtmd.Plo' tmpdepfile='$(DEPDIR)/qtmd.TPlo' @AMDEPBACKSLASH@ |
|
553 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
554 |
+ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o qtmd.lo `test -f 'mspack/qtmd.c' || echo '$(srcdir)/'`mspack/qtmd.c |
|
555 |
+ |
|
556 |
+system.o: mspack/system.c |
|
557 |
+@AMDEP_TRUE@ source='mspack/system.c' object='system.o' libtool=no @AMDEPBACKSLASH@ |
|
558 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/system.Po' tmpdepfile='$(DEPDIR)/system.TPo' @AMDEPBACKSLASH@ |
|
559 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
560 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o system.o `test -f 'mspack/system.c' || echo '$(srcdir)/'`mspack/system.c |
|
561 |
+ |
|
562 |
+system.obj: mspack/system.c |
|
563 |
+@AMDEP_TRUE@ source='mspack/system.c' object='system.obj' libtool=no @AMDEPBACKSLASH@ |
|
564 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/system.Po' tmpdepfile='$(DEPDIR)/system.TPo' @AMDEPBACKSLASH@ |
|
565 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
566 |
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o system.obj `cygpath -w mspack/system.c` |
|
567 |
+ |
|
568 |
+system.lo: mspack/system.c |
|
569 |
+@AMDEP_TRUE@ source='mspack/system.c' object='system.lo' libtool=yes @AMDEPBACKSLASH@ |
|
570 |
+@AMDEP_TRUE@ depfile='$(DEPDIR)/system.Plo' tmpdepfile='$(DEPDIR)/system.TPlo' @AMDEPBACKSLASH@ |
|
571 |
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
|
572 |
+ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o system.lo `test -f 'mspack/system.c' || echo '$(srcdir)/'`mspack/system.c |
|
483 | 573 |
CCDEPMODE = @CCDEPMODE@ |
484 | 574 |
|
485 | 575 |
mostlyclean-libtool: |
... | ... |
@@ -38,6 +38,7 @@ extern "C" |
38 | 38 |
/* return codes */ |
39 | 39 |
#define CL_CLEAN 0 /* virus not found */ |
40 | 40 |
#define CL_VIRUS 1 /* virus found */ |
41 |
+ |
|
41 | 42 |
#define CL_EMAXREC 10 /* recursion level limit exceeded */ |
42 | 43 |
#define CL_EMAXSIZE 11 /* size limit exceeded */ |
43 | 44 |
#define CL_EMAXFILES 12 /* files limit exceeded */ |
... | ... |
@@ -48,6 +49,7 @@ extern "C" |
48 | 48 |
#define CL_EBZIP 104 /* bzip2 handler error */ |
49 | 49 |
#define CL_EOLE2 105 /* OLE2 handler error */ |
50 | 50 |
#define CL_EMSCOMP 106 /* compress.exe handler error */ |
51 |
+#define CL_EMSCAB 107 /* MS CAB module error */ |
|
51 | 52 |
#define CL_EACCES 200 /* access denied */ |
52 | 53 |
#define CL_ENULLARG 300 /* null argument error */ |
53 | 54 |
|
... | ... |
@@ -121,7 +121,9 @@ const char *cl_strerror(int clerror) |
121 | 121 |
case CL_EGZIP: |
122 | 122 |
return "GZip module failure."; |
123 | 123 |
case CL_EMSCOMP: |
124 |
- return "MSExpand module failure."; |
|
124 |
+ return "MS Expand module failure."; |
|
125 |
+ case CL_EMSCAB: |
|
126 |
+ return "MS CAB module failure."; |
|
125 | 127 |
case CL_EOLE2: |
126 | 128 |
return "OLE2 module failure."; |
127 | 129 |
case CL_ETMPFILE: |
... | ... |
@@ -30,12 +30,16 @@ |
30 | 30 |
#include <fcntl.h> |
31 | 31 |
#include <dirent.h> |
32 | 32 |
|
33 |
+#include <mspack.h> |
|
34 |
+ |
|
33 | 35 |
#ifdef CL_THREAD_SAFE |
34 | 36 |
# include <pthread.h> |
35 | 37 |
pthread_mutex_t cli_scanrar_mutex = PTHREAD_MUTEX_INITIALIZER; |
36 | 38 |
#endif |
37 | 39 |
int cli_scanrar_inuse = 0; |
38 | 40 |
|
41 |
+extern short cli_leavetemps_flag; |
|
42 |
+ |
|
39 | 43 |
#include "clamav.h" |
40 | 44 |
#include "others.h" |
41 | 45 |
#include "matcher.h" |
... | ... |
@@ -73,7 +77,7 @@ static const struct cli_magic_s cli_magic[] = { |
73 | 73 |
|
74 | 74 |
/* Executables */ |
75 | 75 |
|
76 |
- /* {0, "MZ", 2, "DOS/W32 executable", CL_DOSEXE}, */ |
|
76 |
+/* {0, "MZ", 2, "DOS/W32 executable", CL_DOSEXE},*/ |
|
77 | 77 |
|
78 | 78 |
/* Archives */ |
79 | 79 |
|
... | ... |
@@ -82,6 +86,7 @@ static const struct cli_magic_s cli_magic[] = { |
82 | 82 |
{0, "\037\213", 2, "GZip", CL_GZFILE}, |
83 | 83 |
{0, "BZh", 3, "BZip", CL_BZFILE}, |
84 | 84 |
{0, "SZDD", 4, "compress.exe'd", CL_MSCFILE}, |
85 |
+ {0, "MSCF", 4, "MS CAB", CL_MSCABFILE}, |
|
85 | 86 |
|
86 | 87 |
/* Mail */ |
87 | 88 |
|
... | ... |
@@ -469,7 +474,7 @@ static int cli_scanzip(int desc, const char **virname, long int *scanned, const |
469 | 469 |
zzip_file_close(zfp); |
470 | 470 |
|
471 | 471 |
if(fflush(tmp) != 0) { |
472 |
- cli_errmsg("fflush() failed: %s\n", strerror(errno)); |
|
472 |
+ cli_dbgmsg("fflush() failed: %s\n", strerror(errno)); |
|
473 | 473 |
ret = CL_EFSYNC; |
474 | 474 |
break; |
475 | 475 |
} |
... | ... |
@@ -596,7 +601,7 @@ static int cli_scanbzip(int desc, const char **virname, long int *scanned, const |
596 | 596 |
|
597 | 597 |
|
598 | 598 |
if((fs = fdopen(dup(desc), "rb")) == NULL) { |
599 |
- cli_errmsg("Can't fdopen() descriptor %d.\n", desc); |
|
599 |
+ cli_dbgmsg("Can't fdopen() descriptor %d.\n", desc); |
|
600 | 600 |
return CL_EBZIP; |
601 | 601 |
} |
602 | 602 |
|
... | ... |
@@ -708,6 +713,61 @@ static int cli_scanmscomp(int desc, const char **virname, long int *scanned, con |
708 | 708 |
return ret; |
709 | 709 |
} |
710 | 710 |
|
711 |
+static int cli_scanmscab(int desc, const char **virname, long int *scanned, const struct cl_node *root, const struct cl_limits *limits, int options, int *reclev) |
|
712 |
+{ |
|
713 |
+ struct mscab_decompressor *cabd = NULL; |
|
714 |
+ struct mscabd_cabinet *base, *cab; |
|
715 |
+ struct mscabd_file *file; |
|
716 |
+ const char *tmpdir; |
|
717 |
+ char *tempname; |
|
718 |
+ int ret = CL_CLEAN; |
|
719 |
+ |
|
720 |
+ |
|
721 |
+ cli_dbgmsg("in cli_scanmscab()\n"); |
|
722 |
+ |
|
723 |
+ if((cabd = mspack_create_cab_decompressor(NULL)) == NULL) { |
|
724 |
+ cli_dbgmsg("Can't create libmspack CAB decompressor\n"); |
|
725 |
+ return CL_EMSCAB; |
|
726 |
+ } |
|
727 |
+ |
|
728 |
+ if((base = cabd->dsearch(cabd, desc)) == NULL) { |
|
729 |
+ cli_dbgmsg("I/O error or no valid cabinets found\n"); |
|
730 |
+ mspack_destroy_cab_decompressor(cabd); |
|
731 |
+ return CL_EMSCAB; |
|
732 |
+ } |
|
733 |
+ |
|
734 |
+ if((tmpdir = getenv("TMPDIR")) == NULL) |
|
735 |
+#ifdef P_tmpdir |
|
736 |
+ tmpdir = P_tmpdir; |
|
737 |
+#else |
|
738 |
+ tmpdir = "/tmp"; |
|
739 |
+#endif |
|
740 |
+ |
|
741 |
+ for(cab = base; cab; cab = cab->next) { |
|
742 |
+ for(file = cab->files; file; file = file->next) { |
|
743 |
+ tempname = cl_gentemp(tmpdir); |
|
744 |
+ cli_dbgmsg("Extracting data to %s\n", tempname); |
|
745 |
+ if(cabd->extract(cabd, file, tempname)) { |
|
746 |
+ cli_dbgmsg("libmscab error code: %d\n", cabd->last_error(cabd)); |
|
747 |
+ } else { |
|
748 |
+ ret = cli_scanfile(tempname, virname, scanned, root, limits, options, reclev); |
|
749 |
+ } |
|
750 |
+ if(!cli_leavetemps_flag) |
|
751 |
+ unlink(tempname); |
|
752 |
+ free(tempname); |
|
753 |
+ if(ret == CL_VIRUS) |
|
754 |
+ break; |
|
755 |
+ } |
|
756 |
+ if(ret == CL_VIRUS) |
|
757 |
+ break; |
|
758 |
+ } |
|
759 |
+ |
|
760 |
+ cabd->close(cabd, base); |
|
761 |
+ mspack_destroy_cab_decompressor(cabd); |
|
762 |
+ |
|
763 |
+ return ret; |
|
764 |
+} |
|
765 |
+ |
|
711 | 766 |
static int cli_scandir(const char *dirname, const char **virname, long int *scanned, const struct cl_node *root, const struct cl_limits *limits, int options, int *reclev) |
712 | 767 |
{ |
713 | 768 |
DIR *dd; |
... | ... |
@@ -746,7 +806,7 @@ static int cli_scandir(const char *dirname, const char **virname, long int *scan |
746 | 746 |
} |
747 | 747 |
} |
748 | 748 |
} else { |
749 |
- cli_errmsg("ScanDir -> Can't open directory %s.\n", dirname); |
|
749 |
+ cli_dbgmsg("ScanDir -> Can't open directory %s.\n", dirname); |
|
750 | 750 |
return CL_EOPEN; |
751 | 751 |
} |
752 | 752 |
|
... | ... |
@@ -772,7 +832,7 @@ static int cli_vba_scandir(const char *dirname, const char **virname, long int * |
772 | 772 |
sprintf(fullname, "%s/%s", vba_project->dir, vba_project->name[i]); |
773 | 773 |
fd = open(fullname, O_RDONLY); |
774 | 774 |
if(fd == -1) { |
775 |
- cli_errmsg("Scan->OLE2 -> Can't open file %s\n", fullname); |
|
775 |
+ cli_dbgmsg("Scan->OLE2 -> Can't open file %s\n", fullname); |
|
776 | 776 |
free(fullname); |
777 | 777 |
ret = CL_EOPEN; |
778 | 778 |
break; |
... | ... |
@@ -813,7 +873,7 @@ static int cli_vba_scandir(const char *dirname, const char **virname, long int * |
813 | 813 |
sprintf(fullname, "%s/%s", vba_project->dir, vba_project->name[i]); |
814 | 814 |
fd = open(fullname, O_RDONLY); |
815 | 815 |
if(fd == -1) { |
816 |
- cli_errmsg("Scan->OLE2 -> Can't open file %s\n", fullname); |
|
816 |
+ cli_dbgmsg("Scan->OLE2 -> Can't open file %s\n", fullname); |
|
817 | 817 |
free(fullname); |
818 | 818 |
ret = CL_EOPEN; |
819 | 819 |
break; |
... | ... |
@@ -869,7 +929,7 @@ static int cli_vba_scandir(const char *dirname, const char **virname, long int * |
869 | 869 |
} |
870 | 870 |
} |
871 | 871 |
} else { |
872 |
- cli_errmsg("ScanDir -> Can't open directory %s.\n", dirname); |
|
872 |
+ cli_dbgmsg("ScanDir -> Can't open directory %s.\n", dirname); |
|
873 | 873 |
return CL_EOPEN; |
874 | 874 |
} |
875 | 875 |
|
... | ... |
@@ -885,9 +945,7 @@ static int cli_scanole2(int desc, const char **virname, long int *scanned, const |
885 | 885 |
|
886 | 886 |
cli_dbgmsg("in cli_scanole2()\n"); |
887 | 887 |
|
888 |
- tmpdir = getenv("TMPDIR"); |
|
889 |
- |
|
890 |
- if(tmpdir == NULL) |
|
888 |
+ if((tmpdir = getenv("TMPDIR")) == NULL) |
|
891 | 889 |
#ifdef P_tmpdir |
892 | 890 |
tmpdir = P_tmpdir; |
893 | 891 |
#else |
... | ... |
@@ -897,12 +955,12 @@ static int cli_scanole2(int desc, const char **virname, long int *scanned, const |
897 | 897 |
/* generate the temporary directory */ |
898 | 898 |
dir = cl_gentemp(tmpdir); |
899 | 899 |
if(mkdir(dir, 0700)) { |
900 |
- cli_errmsg("ScanOLE2 -> Can't create temporary directory %s\n", dir); |
|
900 |
+ cli_dbgmsg("ScanOLE2 -> Can't create temporary directory %s\n", dir); |
|
901 | 901 |
return CL_ETMPDIR; |
902 | 902 |
} |
903 | 903 |
|
904 | 904 |
if((ret = cli_ole2_extract(desc, dir))) { |
905 |
- cli_errmsg("ScanOLE2 -> %s\n", cl_strerror(ret)); |
|
905 |
+ cli_dbgmsg("ScanOLE2 -> %s\n", cl_strerror(ret)); |
|
906 | 906 |
cli_rmdirs(dir); |
907 | 907 |
free(dir); |
908 | 908 |
return ret; |
... | ... |
@@ -931,9 +989,7 @@ static int cli_scanmail(int desc, const char **virname, long int *scanned, const |
931 | 931 |
if(*reclev > 5) /* FIXME: a temporary workaround */ |
932 | 932 |
return CL_CLEAN; |
933 | 933 |
|
934 |
- tmpdir = getenv("TMPDIR"); |
|
935 |
- |
|
936 |
- if(tmpdir == NULL) |
|
934 |
+ if((tmpdir = getenv("TMPDIR")) == NULL) |
|
937 | 935 |
#ifdef P_tmpdir |
938 | 936 |
tmpdir = P_tmpdir; |
939 | 937 |
#else |
... | ... |
@@ -943,7 +999,7 @@ static int cli_scanmail(int desc, const char **virname, long int *scanned, const |
943 | 943 |
/* generate the temporary directory */ |
944 | 944 |
dir = cl_gentemp(tmpdir); |
945 | 945 |
if(mkdir(dir, 0700)) { |
946 |
- cli_errmsg("ScanMail -> Can't create temporary directory %s\n", dir); |
|
946 |
+ cli_dbgmsg("ScanMail -> Can't create temporary directory %s\n", dir); |
|
947 | 947 |
return CL_ETMPDIR; |
948 | 948 |
} |
949 | 949 |
|
... | ... |
@@ -970,7 +1026,7 @@ static int cli_magic_scandesc(int desc, const char **virname, long int *scanned, |
970 | 970 |
|
971 | 971 |
|
972 | 972 |
if(!root) { |
973 |
- cli_errmsg("root == NULL\n"); |
|
973 |
+ cli_errmsg("CRITICAL: root == NULL\n"); |
|
974 | 974 |
return -1; |
975 | 975 |
} |
976 | 976 |
|
... | ... |
@@ -1033,6 +1089,11 @@ static int cli_magic_scandesc(int desc, const char **virname, long int *scanned, |
1033 | 1033 |
ret = cli_scanmscomp(desc, virname, scanned, root, limits, options, reclev); |
1034 | 1034 |
break; |
1035 | 1035 |
|
1036 |
+ case CL_MSCABFILE: |
|
1037 |
+ if(SCAN_ARCHIVE) |
|
1038 |
+ ret = cli_scanmscab(desc, virname, scanned, root, limits, options, reclev); |
|
1039 |
+ break; |
|
1040 |
+ |
|
1036 | 1041 |
case CL_MAILFILE: |
1037 | 1042 |
if(SCAN_MAIL) |
1038 | 1043 |
ret = cli_scanmail(desc, virname, scanned, root, limits, options, reclev); |
... | ... |
@@ -1,5 +1,6 @@ |
1 | 1 |
Test files contain ClamAV-Test-Signature. |
2 |
-You need unrar 3.0 to test rarfail.rar. Only clamscan is able to scan this |
|
3 |
-file (clamd only depends libclamav, which has no support for the new RAR |
|
4 |
-format). Please use clamscan --unrar, and it will automatically switch to the |
|
5 |
-unrar utility after an internal (libclamav's) RAR error. |
|
2 |
+You need unrar 3.0 to detect the test signature in test-failure.rar. Only |
|
3 |
+clamscan is able to scan this file (clamd only depends on libclamav which has |
|
4 |
+no support for the new RAR format). Please use clamscan --unrar, and it will |
|
5 |
+automatically switch to the unrar utility after an internal (libclamav's) |
|
6 |
+RAR module error. |