[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b

Török Edvin edwin at clamav.net
Sun Apr 4 00:52:23 UTC 2010


The following commit has been merged in the debian/unstable branch:
commit 997a1efeb2b80418902461cd67b0be01a10d1148
Author: Török Edvin <edwin at clamav.net>
Date:   Fri Jun 26 16:30:46 2009 +0300

    Draft of bytecode loader.

diff --git a/Makefile.am b/Makefile.am
index cd4c978..8787f48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@
 
 ACLOCAL_AMFLAGS=-I m4
 
-SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop
+SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop clambc
 EXTRA_DIST = FAQ examples BUGS shared libclamav.pc.in libclamunrar_iface/Makefile.am libclamunrar_iface/Makefile.in UPGRADE COPYING.bzip2 COPYING.lzma COPYING.unrar COPYING.LGPL COPYING.file COPYING.zlib COPYING.getopt COPYING.regex COPYING.sha256
 
 bin_SCRIPTS=clamav-config
diff --git a/Makefile.in b/Makefile.in
index 699b06a..20eb5f9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -282,7 +282,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop
+SUBDIRS = libltdl libclamav clamscan clamd clamdscan freshclam sigtool clamconf database docs etc clamav-milter test unit_tests clamdtop clambc
 EXTRA_DIST = FAQ examples BUGS shared libclamav.pc.in libclamunrar_iface/Makefile.am libclamunrar_iface/Makefile.in UPGRADE COPYING.bzip2 COPYING.lzma COPYING.unrar COPYING.LGPL COPYING.file COPYING.zlib COPYING.getopt COPYING.regex COPYING.sha256
 bin_SCRIPTS = clamav-config
 pkgconfigdir = $(libdir)/pkgconfig
@@ -453,7 +453,7 @@ clean-libtool:
 	-rm -rf .libs _libs
 
 distclean-libtool:
-	-rm -f libtool
+	-rm -f libtool config.lt
 install-pkgconfigDATA: $(pkgconfig_DATA)
 	@$(NORMAL_INSTALL)
 	test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)"
@@ -547,7 +547,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/aclocal.m4 b/aclocal.m4
index 8c03fce..b09300b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
@@ -13,13 +13,13 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.63],,
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
 [m4_warning([this file was generated for autoconf 2.63.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -34,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.10'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.10.1], [],
+m4_if([$1], [1.10.2], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -48,12 +48,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # AM_SET_CURRENT_AUTOMAKE_VERSION
 # -------------------------------
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.1])dnl
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
@@ -303,19 +303,28 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
 # Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 3
+#serial 4
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
+[# Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
   # Strip MF so we end up with the name of the file.
   mf=`echo "$mf" | sed -e 's/:.*$//'`
   # Check whether this is an Automake generated Makefile or not.
@@ -647,13 +656,13 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 3
+# serial 4
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -670,7 +679,7 @@ AC_DEFUN([_AM_SET_OPTION],
 # ----------------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 # -------------------------------------------
diff --git a/clamav-config.h.in b/clamav-config.h.in
index f94adea..bcbf9eb 100644
--- a/clamav-config.h.in
+++ b/clamav-config.h.in
@@ -247,7 +247,7 @@
 /* Define to 1 if you have the <mach-o/dyld.h> header file. */
 #undef HAVE_MACH_O_DYLD_H
 
-/* have mallinfo */
+/* Define to 1 if you have the `mallinfo' function. */
 #undef HAVE_MALLINFO
 
 /* Define to 1 if you have the <malloc.h> header file. */
diff --git a/clamav-milter/Makefile.in b/clamav-milter/Makefile.in
index 153fc46..f7785cc 100644
--- a/clamav-milter/Makefile.in
+++ b/clamav-milter/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -297,8 +297,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -479,8 +479,8 @@ install-man8: $(man8_MANS) $(man_MANS)
 	  esac; \
 	done; \
 	for i in $$list; do \
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-	  else file=$$i; fi; \
+	  if test -f $$i; then file=$$i; \
+	  else file=$(srcdir)/$$i; fi; \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
 	  case "$$ext" in \
 	    8*) ;; \
@@ -519,7 +519,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/clamconf/Makefile.in b/clamconf/Makefile.in
index 52263b1..b4a4aa4 100644
--- a/clamconf/Makefile.in
+++ b/clamconf/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -267,8 +267,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -425,7 +425,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/clamd/Makefile.in b/clamd/Makefile.in
index 799eb8e..cad6648 100644
--- a/clamd/Makefile.in
+++ b/clamd/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -317,8 +317,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -515,7 +515,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/clamdscan/Makefile.in b/clamdscan/Makefile.in
index 69db56c..8b2d71f 100644
--- a/clamdscan/Makefile.in
+++ b/clamdscan/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -288,8 +288,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -493,7 +493,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/clamdtop/Makefile.in b/clamdtop/Makefile.in
index 623aa87..80d9c32 100644
--- a/clamdtop/Makefile.in
+++ b/clamdtop/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -259,8 +259,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -422,8 +422,8 @@ install-man1: $(man1_MANS) $(man_MANS)
 	  esac; \
 	done; \
 	for i in $$list; do \
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-	  else file=$$i; fi; \
+	  if test -f $$i; then file=$$i; \
+	  else file=$(srcdir)/$$i; fi; \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
 	  case "$$ext" in \
 	    1*) ;; \
@@ -462,7 +462,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/clamscan/Makefile.in b/clamscan/Makefile.in
index d9ab901..720381a 100644
--- a/clamscan/Makefile.in
+++ b/clamscan/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -278,8 +278,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -468,7 +468,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/config/config.guess b/config/config.guess
index f32079a..da83314 100755
--- a/config/config.guess
+++ b/config/config.guess
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 #   Free Software Foundation, Inc.
 
-timestamp='2008-01-23'
+timestamp='2009-04-27'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	case `/usr/bin/uname -p` in
 	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
     sun4H:SunOS:5.*:*)
 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
@@ -331,7 +334,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
@@ -796,7 +812,7 @@ EOF
 	    x86)
 		echo i586-pc-interix${UNAME_RELEASE}
 		exit ;;
-	    EM64T | authenticamd)
+	    EM64T | authenticamd | genuineintel)
 		echo x86_64-unknown-interix${UNAME_RELEASE}
 		exit ;;
 	    IA64)
@@ -935,6 +951,9 @@ EOF
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
 	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -985,9 +1004,6 @@ EOF
 	  a.out-i386-linux)
 		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
 		exit ;;
-	  coff-i386)
-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
-		exit ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
@@ -1102,8 +1118,11 @@ EOF
     pc:*:*:*)
 	# Left here for compatibility:
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
-        # the processor, so we play safe by assuming i386.
-	echo i386-pc-msdosdjgpp
+        # the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
         exit ;;
     Intel:Mach:3*:*)
 	echo i386-pc-mach3
@@ -1141,6 +1160,16 @@ EOF
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
           && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 	echo m68k-unknown-lynxos${UNAME_RELEASE}
 	exit ;;
@@ -1216,6 +1245,9 @@ EOF
     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
 	echo i586-pc-beos
 	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
     SX-4:SUPER-UX:*:*)
 	echo sx4-nec-superux${UNAME_RELEASE}
 	exit ;;
@@ -1324,6 +1356,9 @@ EOF
     i*86:rdos:*:*)
 	echo ${UNAME_MACHINE}-pc-rdos
 	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/config/config.sub b/config/config.sub
index 6759825..a39437d 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 #   Free Software Foundation, Inc.
 
-timestamp='2008-01-16'
+timestamp='2009-04-17'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
   uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -249,13 +250,16 @@ case $basic_machine in
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | mcore | mep \
+	| maxq | mb | microblaze | mcore | mep | metag \
 	| mips | mipsbe | mipseb | mipsel | mipsle \
 	| mips16 \
 	| mips64 | mips64el \
-	| mips64vr | mips64vrel \
+	| mips64octeon | mips64octeonel \
 	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
 	| mips64vr4100 | mips64vr4100el \
 	| mips64vr4300 | mips64vr4300el \
 	| mips64vr5000 | mips64vr5000el \
@@ -268,6 +272,7 @@ case $basic_machine in
 	| mipsisa64sr71k | mipsisa64sr71kel \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
+	| moxie \
 	| mt \
 	| msp430 \
 	| nios | nios2 \
@@ -277,7 +282,7 @@ case $basic_machine in
 	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
 	| pyramid \
 	| score \
-	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -286,7 +291,7 @@ case $basic_machine in
 	| v850 | v850e \
 	| we32k \
 	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
-	| z8k)
+	| z8k | z80)
 		basic_machine=$basic_machine-unknown
 		;;
 	m6811 | m68hc11 | m6812 | m68hc12)
@@ -329,14 +334,17 @@ case $basic_machine in
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
 	| mips16-* \
 	| mips64-* | mips64el-* \
-	| mips64vr-* | mips64vrel-* \
+	| mips64octeon-* | mips64octeonel-* \
 	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
 	| mips64vr4100-* | mips64vr4100el-* \
 	| mips64vr4300-* | mips64vr4300el-* \
 	| mips64vr5000-* | mips64vr5000el-* \
@@ -358,20 +366,20 @@ case $basic_machine in
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
 	| pyramid-* \
 	| romp-* | rs6000-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
 	| tahoe-* | thumb-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
 	| tron-* \
 	| v850-* | v850e-* | vax-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
 	| xstormy16-* | xtensa*-* \
 	| ymp-* \
-	| z8k-*)
+	| z8k-* | z80-*)
 		;;
 	# Recognize the basic CPU types without company name, with glob match.
 	xtensa*)
@@ -439,6 +447,10 @@ case $basic_machine in
 		basic_machine=m68k-apollo
 		os=-bsd
 		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -459,6 +471,10 @@ case $basic_machine in
 		basic_machine=c90-cray
 		os=-unicos
 		;;
+        cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
 	convex-c1)
 		basic_machine=c1-convex
 		os=-bsd
@@ -526,6 +542,10 @@ case $basic_machine in
 		basic_machine=m88k-motorola
 		os=-sysv3
 		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
 	djgpp)
 		basic_machine=i586-pc
 		os=-msdosdjgpp
@@ -1128,6 +1148,10 @@ case $basic_machine in
 		basic_machine=z8k-unknown
 		os=-sim
 		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
 	none)
 		basic_machine=none-none
 		os=-none
@@ -1166,7 +1190,7 @@ case $basic_machine in
 	we32k)
 		basic_machine=we32k-att
 		;;
-	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
 		basic_machine=sh-unknown
 		;;
 	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1238,8 +1262,9 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+	      | -kopensolaris* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* \
+	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1248,7 +1273,7 @@ case $os in
 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* \
@@ -1388,6 +1413,9 @@ case $os in
 	-zvmoe)
 		os=-zvmoe
 		;;
+	-dicos*)
+		os=-dicos
+		;;
 	-none)
 		;;
 	*)
diff --git a/config/ltmain.sh b/config/ltmain.sh
index c78b5b9..3506ead 100755
--- a/config/ltmain.sh
+++ b/config/ltmain.sh
@@ -65,7 +65,7 @@
 #       compiler:		$LTCC
 #       compiler flags:		$LTCFLAGS
 #       linker:		$LD (gnu? $with_gnu_ld)
-#       $progname:		(GNU libtool) 2.2.6 Debian-2.2.6a-1
+#       $progname:		(GNU libtool) 2.2.6 Debian-2.2.6a-4
 #       automake:		$automake_version
 #       autoconf:		$autoconf_version
 #
@@ -73,7 +73,7 @@
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION="2.2.6 Debian-2.2.6a-1"
+VERSION="2.2.6 Debian-2.2.6a-4"
 TIMESTAMP=""
 package_revision=1.3012
 
@@ -5347,19 +5347,19 @@ func_mode_link ()
 	    # It is a libtool convenience library, so add in its objects.
 	    convenience="$convenience $ladir/$objdir/$old_library"
 	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+	      if $opt_duplicate_deps ; then
+		case "$tmp_libs " in
+		*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+		esac
+	      fi
+	      tmp_libs="$tmp_libs $deplib"
+	    done
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
 	    func_fatal_error "\`$lib' is not a convenience library"
 	  fi
-	  tmp_libs=
-	  for deplib in $dependency_libs; do
-	    deplibs="$deplib $deplibs"
-	    if $opt_duplicate_deps ; then
-	      case "$tmp_libs " in
-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	      esac
-	    fi
-	    tmp_libs="$tmp_libs $deplib"
-	  done
 	  continue
 	fi # $pass = conv
 
diff --git a/configure b/configure
index 4a4c94c..ef5e3b2 100755
--- a/configure
+++ b/configure
@@ -8585,6 +8585,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu)
+    link_all_deplibs=no
+    ;;
   esac
 
   ld_shlibs=yes
@@ -11279,7 +11282,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11282 "configure"
+#line 11285 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11375,7 +11378,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11378 "configure"
+#line 11381 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12526,7 +12529,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12529 "configure"
+#line 12532 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -25391,7 +25394,7 @@ else
 fi
 
 
-ac_config_files="$ac_config_files libclamav/Makefile libclamav/lzma/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile etc/Makefile test/Makefile unit_tests/Makefile clamdtop/Makefile Makefile clamav-config libclamav.pc docs/man/clamav-milter.8 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1 docs/man/clamdtop.1"
+ac_config_files="$ac_config_files libclamav/Makefile libclamav/lzma/Makefile clamscan/Makefile database/Makefile docs/Makefile clamd/Makefile clamdscan/Makefile clamav-milter/Makefile freshclam/Makefile sigtool/Makefile clamconf/Makefile etc/Makefile test/Makefile unit_tests/Makefile clamdtop/Makefile clambc/Makefile Makefile clamav-config libclamav.pc docs/man/clamav-milter.8 docs/man/clamconf.1 docs/man/clamd.8 docs/man/clamd.conf.5 docs/man/clamdscan.1 docs/man/clamscan.1 docs/man/freshclam.1 docs/man/freshclam.conf.5 docs/man/sigtool.1 docs/man/clamdtop.1"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -26388,6 +26391,7 @@ do
     "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
     "unit_tests/Makefile") CONFIG_FILES="$CONFIG_FILES unit_tests/Makefile" ;;
     "clamdtop/Makefile") CONFIG_FILES="$CONFIG_FILES clamdtop/Makefile" ;;
+    "clambc/Makefile") CONFIG_FILES="$CONFIG_FILES clambc/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "clamav-config") CONFIG_FILES="$CONFIG_FILES clamav-config" ;;
     "libclamav.pc") CONFIG_FILES="$CONFIG_FILES libclamav.pc" ;;
@@ -26454,7 +26458,7 @@ $debug ||
 if test -n "$CONFIG_FILES"; then
 
 
-ac_cr=`echo X | tr X '\015'`
+ac_cr='
'
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
   ac_cs_awk_cr='\\r'
@@ -27055,7 +27059,16 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
   # Strip MF so we end up with the name of the file.
   mf=`echo "$mf" | sed -e 's/:.*$//'`
   # Check whether this is an Automake generated Makefile or not.
diff --git a/configure.in b/configure.in
index ddbcf48..449eaf9 100644
--- a/configure.in
+++ b/configure.in
@@ -1589,6 +1589,7 @@ etc/Makefile
 test/Makefile
 unit_tests/Makefile
 clamdtop/Makefile
+clambc/Makefile
 Makefile
 clamav-config
 libclamav.pc
diff --git a/database/Makefile.in b/database/Makefile.in
index 0a5c78e..8f0dfe5 100644
--- a/database/Makefile.in
+++ b/database/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -235,8 +235,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
diff --git a/docs/Makefile.in b/docs/Makefile.in
index fceab76..1a31ead 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -241,8 +241,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -283,8 +283,8 @@ install-man1: $(man1_MANS) $(man_MANS)
 	  esac; \
 	done; \
 	for i in $$list; do \
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-	  else file=$$i; fi; \
+	  if test -f $$i; then file=$$i; \
+	  else file=$(srcdir)/$$i; fi; \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
 	  case "$$ext" in \
 	    1*) ;; \
@@ -328,8 +328,8 @@ install-man5: $(man5_MANS) $(man_MANS)
 	  esac; \
 	done; \
 	for i in $$list; do \
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-	  else file=$$i; fi; \
+	  if test -f $$i; then file=$$i; \
+	  else file=$(srcdir)/$$i; fi; \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
 	  case "$$ext" in \
 	    5*) ;; \
@@ -373,8 +373,8 @@ install-man8: $(man8_MANS) $(man_MANS)
 	  esac; \
 	done; \
 	for i in $$list; do \
-	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
-	  else file=$$i; fi; \
+	  if test -f $$i; then file=$$i; \
+	  else file=$(srcdir)/$$i; fi; \
 	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
 	  case "$$ext" in \
 	    8*) ;; \
diff --git a/etc/Makefile.in b/etc/Makefile.in
index 130065c..39fa7ab 100644
--- a/etc/Makefile.in
+++ b/etc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -234,8 +234,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
diff --git a/freshclam/Makefile.in b/freshclam/Makefile.in
index ee19c3f..90aa712 100644
--- a/freshclam/Makefile.in
+++ b/freshclam/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -290,8 +290,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -499,7 +499,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/libclamav/Makefile.am b/libclamav/Makefile.am
index 4945fe0..d67dc5d 100644
--- a/libclamav/Makefile.am
+++ b/libclamav/Makefile.am
@@ -285,7 +285,9 @@ libclamav_la_SOURCES = \
 	default.h\
 	sha256.c\
 	sha256.h\
-	bignum.h
+	bignum.h\
+	bytecode.c\
+	bytecode.h
 
 if !LINK_TOMMATH
 libclamav_la_SOURCES += bignum.c \
diff --git a/libclamav/Makefile.in b/libclamav/Makefile.in
index 3121a45..3e3cadb 100644
--- a/libclamav/Makefile.in
+++ b/libclamav/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -121,7 +121,7 @@ am__libclamav_la_SOURCES_DIST = clamav.h matcher-ac.c matcher-ac.h \
 	textnorm.h dlp.c dlp.h jsparse/js-norm.c jsparse/js-norm.h \
 	jsparse/lexglobal.h jsparse/textbuf.h uniq.c uniq.h version.c \
 	version.h mpool.c mpool.h default.h sha256.c sha256.h bignum.h \
-	bignum.c bignum_class.h
+	bytecode.c bytecode.h bignum.c bignum_class.h
 @LINK_TOMMATH_FALSE at am__objects_1 = libclamav_la-bignum.lo
 am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \
 	libclamav_la-matcher-bm.lo libclamav_la-matcher.lo \
@@ -158,7 +158,8 @@ am_libclamav_la_OBJECTS = libclamav_la-matcher-ac.lo \
 	libclamav_la-textnorm.lo libclamav_la-dlp.lo \
 	libclamav_la-js-norm.lo libclamav_la-uniq.lo \
 	libclamav_la-version.lo libclamav_la-mpool.lo \
-	libclamav_la-sha256.lo $(am__objects_1)
+	libclamav_la-sha256.lo libclamav_la-bytecode.lo \
+	$(am__objects_1)
 libclamav_la_OBJECTS = $(am_libclamav_la_OBJECTS)
 libclamav_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libclamav_la_CFLAGS) \
@@ -528,7 +529,7 @@ libclamav_la_SOURCES = clamav.h matcher-ac.c matcher-ac.h matcher-bm.c \
 	explode.h textnorm.c textnorm.h dlp.c dlp.h jsparse/js-norm.c \
 	jsparse/js-norm.h jsparse/lexglobal.h jsparse/textbuf.h uniq.c \
 	uniq.h version.c version.h mpool.c mpool.h default.h sha256.c \
-	sha256.h bignum.h $(am__append_7)
+	sha256.h bignum.h bytecode.c bytecode.h $(am__append_7)
 noinst_LTLIBRARIES = libclamav_internal_utils.la libclamav_internal_utils_nothreads.la
 COMMON_CLEANFILES = version.h version.h.tmp *.gcda *.gcno lzma/*.gcda lzma/*.gcno
 @MAINTAINER_MODE_TRUE at BUILT_SOURCES = jsparse/generated/operators.h jsparse/generated/keywords.h jsparse-keywords.gperf
@@ -544,8 +545,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -643,6 +644,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-bignum.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-binhex.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-blob.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-bytecode.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-bzlib.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-cab.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libclamav_la-chmunpack.Plo at am__quote@
@@ -1238,6 +1240,13 @@ libclamav_la-sha256.lo: sha256.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-sha256.lo `test -f 'sha256.c' || echo '$(srcdir)/'`sha256.c
 
+libclamav_la-bytecode.lo: bytecode.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-bytecode.lo -MD -MP -MF $(DEPDIR)/libclamav_la-bytecode.Tpo -c -o libclamav_la-bytecode.lo `test -f 'bytecode.c' || echo '$(srcdir)/'`bytecode.c
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libclamav_la-bytecode.Tpo $(DEPDIR)/libclamav_la-bytecode.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='bytecode.c' object='libclamav_la-bytecode.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -c -o libclamav_la-bytecode.lo `test -f 'bytecode.c' || echo '$(srcdir)/'`bytecode.c
+
 libclamav_la-bignum.lo: bignum.c
 @am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libclamav_la_CFLAGS) $(CFLAGS) -MT libclamav_la-bignum.lo -MD -MP -MF $(DEPDIR)/libclamav_la-bignum.Tpo -c -o libclamav_la-bignum.lo `test -f 'bignum.c' || echo '$(srcdir)/'`bignum.c
 @am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libclamav_la-bignum.Tpo $(DEPDIR)/libclamav_la-bignum.Plo
@@ -1518,7 +1527,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/libclamav/bytecode.c b/libclamav/bytecode.c
new file mode 100644
index 0000000..c887f87
--- /dev/null
+++ b/libclamav/bytecode.c
@@ -0,0 +1,474 @@
+/*
+ *  Load, verify and execute ClamAV bytecode.
+ *
+ *  Copyright (C) 2009 Sourcefire, Inc.
+ *
+ *  Authors: Török Edvin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ */
+
+#if HAVE_CONFIG_H
+#include "clamav-config.h"
+#endif
+
+#include "clamav.h"
+#include "others.h"
+#include "bytecode.h"
+#include "readdb.h"
+#include <string.h>
+
+struct cli_bc_varop {
+    uint8_t numOps;
+    uint16_t* ops;
+};
+
+struct cli_bc_inst {
+    enum bc_opcode opcode;
+    uint16_t type;
+    union {
+	uint16_t unaryop;
+	uint16_t binop[2];
+	struct cli_bc_varop ops;
+    } u;
+};
+
+struct cli_bc_bb {
+    unsigned numInsts;
+    struct cli_bc_inst *insts;
+};
+
+struct cli_bc_func {
+    uint8_t numArgs;
+    uint16_t numLocals;
+    uint16_t numBB;
+    uint16_t *types;
+    struct cli_bc_bb *BB;
+};
+
+struct cli_bc_ctx {
+    unsigned dummy;
+};
+
+struct cli_bc_ctx *cli_bytecode_alloc_context(void)
+{
+    struct cli_bc_ctx *ctx = cli_malloc(sizeof(*ctx));
+    return ctx;
+}
+
+void cli_bytecode_destroy_context(struct cli_bc_ctx *ctx)
+{
+   free(ctx);
+}
+
+
+static inline uint64_t readNumber(const unsigned char *p, unsigned *off, unsigned len, char *ok)
+{
+    uint64_t n=0;
+    unsigned i, newoff, lim, p0 = p[*off], shift=0;
+
+    lim = p0 - 0x60;
+    if (lim > 0x10) {
+	cli_errmsg("Invalid number type: %c\n", p0);
+	*ok = 0;
+	return 0;
+    }
+    newoff = *off +lim+1;
+    if (newoff > len) {
+	cli_errmsg("End of line encountered while reading number\n");
+	*ok = 0;
+	return 0;
+    }
+
+    if (p0 == 0x60) {
+	*off = newoff;
+	return 0;
+    }
+
+    for (i=*off+1;i < newoff; i++) {
+	uint64_t v = p[i];
+	if (UNLIKELY((v&0xf0) != 0x60)) {
+	    cli_errmsg("Invalid number part: %c\n", v);
+	    *ok = 0;
+	    return 0;
+	}
+	v &= 0xf;
+	v <<= shift;
+	n |= v;
+	shift += 4;
+    }
+    *off = newoff;
+    return n;
+}
+
+static inline uint64_t readOperand(unsigned char *p, unsigned *off, unsigned len, char *ok)
+{
+    if ((p[*off]&0xf0) == 0x40) {
+	p[*off] |= 0x20;
+	/* TODO: constant int operand needs to be added to constant table*/
+	return readNumber(p, off, len, ok);
+    }
+    return readNumber(p, off, len, ok);
+}
+static inline unsigned readFixedNumber(const unsigned char *p, unsigned *off,
+				       unsigned len, char *ok, unsigned width)
+{
+    unsigned i, n=0, shift=0;
+    unsigned newoff = *off + width;
+    if (newoff > len) {
+	cli_errmsg("Newline encountered while reading number\n");
+	*ok = 0;
+	return 0;
+    }
+    for (i=*off;i<newoff;i++) {
+	unsigned v = p[i];
+	if (UNLIKELY((v&0xf0) != 0x60)) {
+	    cli_errmsg("Invalid number part: %c\n", v);
+	    *ok = 0;
+	    return 0;
+	}
+	v &= 0xf;
+	v <<= shift;
+	n |= v;
+	shift += 4;
+    }
+    *off = newoff;
+    return n;
+}
+
+static inline char *readData(const unsigned char *p, unsigned *off, unsigned len, char *ok)
+{
+    unsigned char *dat, *q;
+    unsigned l, newoff, i;
+    if (p[*off] != '|') {
+	cli_errmsg("Data start marker missing: %c\n", p[*off]);
+	*ok = 0;
+	return NULL;
+    }
+    (*off)++;
+    l = readNumber(p, off, len, ok);
+    if (!l)
+	return NULL;
+    newoff = *off + l;
+    if (newoff > len) {
+	cli_errmsg("Line ended while reading data\n");
+	*ok = 0;
+	return 0;
+    }
+    dat = cli_malloc(l);
+    if (!dat) {
+	cli_errmsg("Cannot allocate memory for data\n");
+	*ok = 0;
+	return NULL;
+    }
+    q = dat;
+    for (i=*off;i<newoff;i++) {
+	const unsigned char v = p[i];
+	if (UNLIKELY((v&0xf0) != 0x60)) {
+	    cli_errmsg("Invalid data part: %c\n", v);
+	    *ok = 0;
+	    return 0;
+	}
+	*q++ = v;
+    }
+    *off = newoff;
+    return dat;
+}
+
+static int parseHeader(struct cli_bc *bc, char *buffer)
+{
+    uint64_t magic1;
+    unsigned magic2;
+    char ok = 1;
+    unsigned offset, len, flevel;
+    if (strncmp(buffer, BC_HEADER, sizeof(BC_HEADER)-1)) {
+	cli_errmsg("Missing file magic in bytecode");
+	return CL_EMALFDB;
+    }
+    offset = sizeof(BC_HEADER)-1;
+    len = strlen(buffer);
+    flevel = readNumber(buffer, &offset, len, &ok);
+    if (!ok) {
+	cli_errmsg("Unable to parse functionality level in bytecode header\n");
+	return CL_EMALFDB;
+    }
+    if (flevel > BC_FUNC_LEVEL) {
+	cli_dbgmsg("Skipping bytecode with functionality level: %u\n", flevel);
+	return CL_BREAK;
+    }
+    // Optimistic parsing, check for error only at the end.
+    bc->verifier = readNumber(buffer, &offset, len, &ok);
+    bc->sigmaker = readData(buffer, &offset, len, &ok);
+    bc->id = readNumber(buffer, &offset, len, &ok);
+    bc->metadata.maxStack = readNumber(buffer, &offset, len, &ok);
+    bc->metadata.maxMem = readNumber(buffer, &offset, len, &ok);
+    bc->metadata.maxTime = readNumber(buffer, &offset, len, &ok);
+    bc->metadata.targetExclude = readData(buffer, &offset, len, &ok);
+    bc->num_func = readNumber(buffer, &offset, len, &ok);
+    if (!ok) {
+	cli_errmsg("Invalid bytecode header\n", offset);
+	return CL_EMALFDB;
+    }
+    magic1 = readNumber(buffer, &offset, len, &ok);
+    magic2 = readFixedNumber(buffer, &offset, len, &ok, 2);
+    if (!ok || magic1 != 0x53e5493e9f3d1c30ull || magic2 != 42) {
+      unsigned m0 = magic1 >> 32;
+      unsigned m1 = magic1;
+      cli_errmsg("Magic numbers don't match: %lx%lx, %u\n", m0, m1, magic2);
+      return CL_EMALFDB;
+    }
+    if (offset != len) {
+	cli_errmsg("Trailing garbage in bytecode header: %d extra bytes\n",
+		   len-offset);
+	return CL_EMALFDB;
+    }
+
+    bc->funcs = cli_calloc(bc->num_func, sizeof(*bc->funcs));
+    if (!bc->funcs) {
+	cli_errmsg("Out of memory allocating %u functions\n", bc->num_func);
+	return CL_EMEM;
+    }
+    return CL_SUCCESS;
+}
+
+static int parseFunctionHeader(struct cli_bc *bc, unsigned fn, char *buffer)
+{
+    char ok=1;
+    unsigned offset, len, all_locals=0, i;
+    struct cli_bc_func *func;
+
+    if (fn >= bc->num_func) {
+	cli_errmsg("Found more functions than declared: %u >= %u\n", fn,
+		   bc->num_func);
+	return CL_EMALFDB;
+    }
+    func = &bc->funcs[fn];
+    len = strlen(buffer);
+
+    if (buffer[0] != 'A') {
+	cli_errmsg("Invalid function arguments header: %c\n", buffer[0]);
+	return CL_EMALFDB;
+    }
+    offset = 1;
+    func->numArgs = readFixedNumber(buffer, &offset, len, &ok, 1);
+    if (buffer[offset] != 'L') {
+	cli_errmsg("Invalid function locals header: %c\n", buffer[offset]);
+	return CL_EMALFDB;
+    }
+    offset++;
+    func->numLocals = readNumber(buffer, &offset, len, &ok);
+    if (!ok) {
+	cli_errmsg("Invalid number of arguments/locals\n");
+	return CL_EMALFDB;
+    }
+    all_locals = func->numArgs + func->numLocals;
+    func->types = cli_calloc(all_locals, sizeof(*func->types));
+    if (!func->types) {
+	cli_errmsg("Out of memory allocating function arguments\n");
+	return CL_EMEM;
+    }
+    for (i=0;i<all_locals;i++) {
+	func->types[i] = readNumber(buffer, &offset, len, &ok);
+    }
+    if (!ok) {
+	cli_errmsg("Invalid local types\n");
+	return CL_EMALFDB;
+    }
+    if (buffer[offset] != 'F') {
+	cli_errmsg("Invalid function body header: %c\n", buffer[offset]);
+	return CL_EMALFDB;
+    }
+    offset++;
+    func->numBB = readNumber(buffer, &offset, len, &ok);
+    if (!ok) {
+	cli_errmsg("Invalid basic block count\n");
+	return CL_EMALFDB;
+    }
+    func->BB = cli_calloc(func->numBB, sizeof(*func->BB));
+    if (!func->BB) {
+	cli_errmsg("Out of memory allocating basic blocks\n");
+	return CL_EMEM;
+    }
+    return CL_SUCCESS;
+}
+
+static int parseBB(struct cli_bc *bc, unsigned func, unsigned bb, char *buffer)
+{
+    char ok=1;
+    unsigned offset, len, last = 0;
+    struct cli_bc_bb *BB;
+    struct cli_bc_inst inst;
+
+    if (bb >= bc->funcs[func].numBB) {
+	cli_errmsg("Found too many basic blocks\n");
+	return CL_EMALFDB;
+    }
+
+    BB = &bc->funcs[func].BB[bb];
+    len = strlen(buffer);
+    if (buffer[0] != 'B') {
+	cli_errmsg("Invalid basic block header: %c\n", buffer[0]);
+	return CL_EMALFDB;
+    }
+    offset = 1;
+    BB->numInsts = 0;
+    BB->insts = NULL;
+    while (!last) {
+	unsigned numOp, i;
+	if (buffer[offset] == 'T') {
+	    last = 1;
+	    offset++;
+	    /* terminators are void */
+	    inst.type = 0;
+	} else {
+	    inst.type = readNumber(buffer, &offset, len, &ok);
+	}
+	inst.opcode = readFixedNumber(buffer, &offset, len, &ok, 2);
+	if (!ok) {
+	    cli_errmsg("Invalid type or operand\n");
+	    return CL_EMALFDB;
+	}
+	if (inst.opcode >= OP_INVALID) {
+	    cli_errmsg("Invalid opcode: %u\n", inst.opcode);
+	    return CL_EMALFDB;
+	}
+	numOp = operand_counts[inst.opcode];
+	switch (numOp) {
+	    case 1:
+		inst.u.unaryop = readOperand(buffer, &offset, len, &ok);
+		break;
+	    case 2:
+		inst.u.binop[0] = readOperand(buffer, &offset, len, &ok);
+		inst.u.binop[1] = readOperand(buffer, &offset, len, &ok);
+		break;
+	    default:
+		inst.u.ops.numOps = numOp;
+		inst.u.ops.ops = cli_calloc(numOp, sizeof(*inst.u.ops.ops));
+		if (!inst.u.ops.ops) {
+		    cli_errmsg("Out of memory allocating operands\n");
+		    return CL_EMALFDB;
+		}
+		for (i=0;i<numOp;i++) {
+		    inst.u.ops.ops[i] = readOperand(buffer, &offset, len, &ok);
+		}
+		break;
+	}
+	if (!ok) {
+	    cli_errmsg("Invalid instructions or operands\n");
+	    return CL_EMALFDB;
+	}
+	BB->insts = cli_realloc2(BB->insts, (++BB->numInsts)*sizeof(*BB->insts));
+	if (!BB->insts) {
+	    cli_errmsg("Unable to allocate memory for instruction %u\n", 
+		       BB->numInsts);
+	    return CL_EMEM;
+	}
+	BB->insts[BB->numInsts-1] = inst;
+    }
+    if (bb == bc->funcs[func].numBB-1) {
+	if (buffer[offset] != 'E') {
+	    cli_errmsg("Missing basicblock terminator, got: %c\n", buffer[offset]);
+	    return CL_EMALFDB;
+	}
+	offset++;
+    }
+    cli_dbgmsg("Parsed %d instructions\n", BB->numInsts);
+    if (offset != len) {
+	cli_errmsg("Trailing garbage in basicblock: %d extra bytes\n",
+		   len-offset);
+	return CL_EMALFDB;
+    }
+    return CL_SUCCESS;
+}
+
+enum parse_state {
+    PARSE_BC_HEADER=0,
+    PARSE_FUNC_HEADER,
+    PARSE_BB
+};
+
+int cli_bytecode_load(struct cli_bc *bc, FILE *f, struct cli_dbio *dbio)
+{
+    unsigned row = 0, current_func = 0, bb=0;
+    char buffer[FILEBUFF];
+    enum parse_state state = PARSE_BC_HEADER;
+
+    if (!f && !dbio) {
+	cli_errmsg("Unable to load bytecode (null file)\n");
+	return CL_ENULLARG;
+    }
+
+    while (cli_dbgets(buffer, FILEBUFF, f, dbio)) {
+	int rc;
+	cli_chomp(buffer);
+	switch (state) {
+	    case PARSE_BC_HEADER:
+		rc = parseHeader(bc, buffer);
+		if (rc == CL_BREAK) /* skip */
+		    return CL_SUCCESS;
+		if (rc != CL_SUCCESS)
+		    return rc;
+		state = PARSE_FUNC_HEADER;
+		break;
+	    case PARSE_FUNC_HEADER:
+		rc = parseFunctionHeader(bc, current_func, buffer);
+		if (rc != CL_SUCCESS)
+		    return rc;
+		bb = 0;
+		state = PARSE_BB;
+		break;
+	    case PARSE_BB:
+		rc = parseBB(bc, current_func, bb++, buffer);
+		if (rc != CL_SUCCESS)
+		    return rc;
+		if (bb >= bc->funcs[current_func].numBB) {
+		    state = PARSE_FUNC_HEADER;
+		    current_func++;
+		}
+		break;
+	}
+    }
+    cli_dbgmsg("Parsed %d functions\n", current_func);
+    return CL_SUCCESS;
+}
+
+void cli_bytecode_run(struct cli_bc *bc, struct cli_bc_ctx *ctx)
+{
+}
+
+void cli_bytecode_destroy(struct cli_bc *bc)
+{
+    unsigned i, j, k;
+    free(bc->sigmaker);
+    free(bc->metadata.targetExclude);
+
+    for (i=0;i<bc->num_func;i++) {
+	struct cli_bc_func *f = &bc->funcs[i];
+	free(f->types);
+
+	for (j=0;j<f->numBB;j++) {
+	    struct cli_bc_bb *BB = &f->BB[j];
+	    for(k=0;k<BB->numInsts;k++) {
+		struct cli_bc_inst *i = &BB->insts[k];
+		if (operand_counts[i->opcode] > 2)
+		    free(i->u.ops.ops);
+	    }
+	    free(BB->insts);
+	}
+	free(f->BB);
+    }
+    free(bc->funcs);
+}
+
diff --git a/shared/fdpassing.h b/libclamav/bytecode.h
similarity index 54%
copy from shared/fdpassing.h
copy to libclamav/bytecode.h
index 8cac9b9..976f5dd 100644
--- a/shared/fdpassing.h
+++ b/libclamav/bytecode.h
@@ -1,4 +1,6 @@
 /*
+ *  Load, verify and execute ClamAV bytecode.
+ *
  *  Copyright (C) 2009 Sourcefire, Inc.
  *
  *  Authors: Török Edvin
@@ -17,37 +19,28 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  *  MA 02110-1301, USA.
  */
-#ifndef FDPASSING_H
-#define FDPASSING_H
-
-#ifdef HAVE_FD_PASSING
-
-#ifdef FDPASS_NEED_XOPEN
-/* to expose BSD 4.4/Unix98 semantics instead of BSD 4.3 semantics */
-#define _XOPEN_SOURCE 500
-#endif
+#ifndef BYTECODE_H
+#define BYTECODE_H
+#include <stdio.h>
+#include "clambc.h"
+struct cli_dbio;
+struct cli_bc_ctx;
+struct cli_bc_func;
+
+struct cli_bc {
+  unsigned verifier;
+  char *sigmaker;
+  unsigned id;
+  struct bytecode_metadata metadata;
+  unsigned num_func;
+  struct cli_bc_func *funcs;
+};
+
+struct cli_bc_ctx *cli_bytecode_alloc_context(void);
+void cli_bytecode_destroy_context(struct cli_bc_ctx *ctx);
+
+int cli_bytecode_load(struct cli_bc *bc, FILE *f, struct cli_dbio *dbio);
+void cli_bytecode_run(struct cli_bc *bc, struct cli_bc_ctx *ctx);
+void cli_bytecode_destroy(struct cli_bc *bc);
 
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/uio.h>
-
-/* Solaris 8 */
-#if !defined CMSG_SPACE || !defined CMSG_LEN
-#ifndef ALIGN
-#define ALIGN(len) len
-#endif
-
-#ifndef CMSG_SPACE
-#define CMSG_SPACE(len) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(len))
 #endif
-
-#ifndef CMSG_LEN
-#define CMSG_LEN(len) (ALIGN(sizeof(struct cmsghdr)) + len)
-#endif
-#endif
-
-
-#endif
-#endif
-
diff --git a/libclamav/clambc.h b/libclamav/clambc.h
new file mode 100644
index 0000000..93cd1eb
--- /dev/null
+++ b/libclamav/clambc.h
@@ -0,0 +1,81 @@
+/*
+ *  ClamAV bytecode definitions.
+ *
+ *  Copyright (C) 2009 Sourcefire, Inc.
+ *
+ *  Authors: Török Edvin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ */
+#ifndef CLAMBC_H
+#define CLAMBC_H
+
+struct bytecode_metadata {
+  unsigned long maxStack, maxMem;
+  unsigned long maxTime;
+  const char *targetExclude;
+};
+
+#define BC_FUNC_LEVEL 1
+#define BC_HEADER "ClamBC"
+
+enum bc_opcode {
+  OP_ADD=1,
+  OP_SUB,
+  OP_MUL,
+  OP_UDIV,
+  OP_SDIV,
+  OP_UREM,
+  OP_SREM,
+  OP_SHL,
+  OP_LSHR,
+  OP_ASHR,
+  OP_AND,
+  OP_OR,
+  OP_XOR,
+
+  OP_TRUNC,
+  OP_SEXT,
+  OP_ZEXT,
+  OP_RET,
+
+  OP_ICMP_EQ,
+  OP_ICMP_NE,
+  OP_ICMP_UGT,
+  OP_ICMP_UGE,
+  OP_ICMP_ULT,
+  OP_ICMP_ULE,
+  OP_ICMP_SGT,
+  OP_ICMP_SGE,
+  OP_ICMP_SLE,
+  OP_ICMP_SLT,
+  OP_SELECT,
+  OP_INVALID /* last */
+};
+
+static const unsigned char operand_counts[] = {
+  0,
+  /* ADD -> XOR */
+  2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+  /* TRUNC -> ZEXT */
+  2, 2, 2,
+  /* RET */
+  1,
+  /* ICMP */
+  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+  /* SELECT */
+  3
+};
+#endif
diff --git a/libclamav/libclamav.map b/libclamav/libclamav.map
index 7f1b106..c9c099a 100644
--- a/libclamav/libclamav.map
+++ b/libclamav/libclamav.map
@@ -144,6 +144,11 @@ CLAMAV_PRIVATE {
     messageDestroy;
     base64Flush;
     have_rar;
+    cli_bytecode_load;
+    cli_bytecode_run;
+    cli_bytecode_destroy;
+    cli_bytecode_alloc_context;
+    cli_bytecode_destroy_context;
   local:
     *;
 };
diff --git a/libclamav/lzma/Makefile.in b/libclamav/lzma/Makefile.in
index 13ae2d3..426cc8c 100644
--- a/libclamav/lzma/Makefile.in
+++ b/libclamav/lzma/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -260,8 +260,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -337,7 +337,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am
index c33a0a4..a597b1d 100644
--- a/libltdl/Makefile.am
+++ b/libltdl/Makefile.am
@@ -28,9 +28,6 @@
 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #####
 
-# ClamAV: filter -Werror here
-CFLAGS=`echo "@CFLAGS@" | sed -e 's/-Werror[^=-]//'`
-
 ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = foreign
 AM_CPPFLAGS =
diff --git a/libltdl/Makefile.in b/libltdl/Makefile.in
index c36ca2a..697c528 100644
--- a/libltdl/Makefile.in
+++ b/libltdl/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -163,9 +163,7 @@ AWK = @AWK@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFGDIR = @CFGDIR@
-
-# ClamAV: filter -Werror here
-CFLAGS = `echo "@CFLAGS@" | sed -e 's/-Werror[^=-]//'`
+CFLAGS = @CFLAGS@
 CHECK_CPPFLAGS = @CHECK_CPPFLAGS@
 CHECK_LIBS = @CHECK_LIBS@
 CLAMAVGROUP = @CLAMAVGROUP@
@@ -383,8 +381,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -678,7 +676,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c
index 6e19599..80b5675 100644
--- a/libltdl/ltdl.c
+++ b/libltdl/ltdl.c
@@ -1614,6 +1614,9 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
 {
   lt_dlhandle	handle	= 0;
   int		errors	= 0;
+  const char *	saved_error	= 0;
+
+  LT__GETERROR (saved_error);
 
   /* Can't have symbols hidden and visible at the same time!  */
   if (advise && advise->is_symlocal && advise->is_symglobal)
@@ -1650,6 +1653,7 @@ lt_dlopenadvise (const char *filename, lt_dladvise advise)
 
 #if defined(LT_MODULE_EXT)
       /* Try appending SHLIB_EXT.   */
+      LT__SETERRORSTR (saved_error);
       errors = try_dlopen (&handle, filename, shlib_ext, advise);
 
       /* As before, if the file was found but loading failed, return now
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 2ca1c1f..1e7ea47 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -4261,6 +4261,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
   openbsd*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
diff --git a/sigtool/Makefile.in b/sigtool/Makefile.in
index 30e5964..4b7a6f9 100644
--- a/sigtool/Makefile.in
+++ b/sigtool/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -276,8 +276,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -480,7 +480,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
diff --git a/test/Makefile.in b/test/Makefile.in
index 994fab8..d7329b0 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -224,8 +224,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
diff --git a/unit_tests/Makefile.in b/unit_tests/Makefile.in
index ea753a4..b11c90f 100644
--- a/unit_tests/Makefile.in
+++ b/unit_tests/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -289,8 +289,8 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
 	    *$$dep*) \
-	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
-		&& exit 0; \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
 	      exit 1;; \
 	  esac; \
 	done; \
@@ -532,7 +532,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	unique=`for i in $$list; do \
 	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 	  done | \
-	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 	mkid -fID $$unique
 tags: TAGS
@@ -575,7 +575,7 @@ distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
 check-TESTS: $(TESTS)
-	@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[	 ]'; \
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
 	srcdir=$(srcdir); export srcdir; \
 	list=' $(TESTS) '; \
 	if test -n "$$list"; then \
@@ -586,7 +586,7 @@ check-TESTS: $(TESTS)
 	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *$$ws$$tst$$ws*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xpass=`expr $$xpass + 1`; \
 		failed=`expr $$failed + 1`; \
 		echo "XPASS: $$tst"; \
@@ -598,7 +598,7 @@ check-TESTS: $(TESTS)
 	    elif test $$? -ne 77; then \
 	      all=`expr $$all + 1`; \
 	      case " $(XFAIL_TESTS) " in \
-	      *$$ws$$tst$$ws*) \
+	      *[\ \	]$$tst[\ \	]*) \
 		xfail=`expr $$xfail + 1`; \
 		echo "XFAIL: $$tst"; \
 	      ;; \
@@ -612,23 +612,36 @@ check-TESTS: $(TESTS)
 	      echo "SKIP: $$tst"; \
 	    fi; \
 	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
 	  if test "$$failed" -eq 0; then \
 	    if test "$$xfail" -eq 0; then \
-	      banner="All $$all tests passed"; \
+	      banner="$$All$$all $$tests passed"; \
 	    else \
-	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
 	    fi; \
 	  else \
 	    if test "$$xpass" -eq 0; then \
-	      banner="$$failed of $$all tests failed"; \
+	      banner="$$failed of $$all $$tests failed"; \
 	    else \
-	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
 	    fi; \
 	  fi; \
 	  dashes="$$banner"; \
 	  skipped=""; \
 	  if test "$$skip" -ne 0; then \
-	    skipped="($$skip tests were not run)"; \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
 	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
 	      dashes="$$skipped"; \
 	  fi; \

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list