diff -dPNur clamav-0.93.3/libclamav/clamav.h clamav-0.93.3-ds/libclamav/clamav.h
--- clamav-0.93.3/libclamav/clamav.h	2008-04-28 16:18:33.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/clamav.h	2008-08-18 22:24:59.000000000 +0200
@@ -65,6 +65,7 @@
 #define CL_ESUPPORT	-125 /* not supported data format */
 #define CL_ELOCKDB	-126 /* can't lock DB directory */
 #define CL_EARJ         -127 /* ARJ handler error */
+#define CL_E7ZIP	-128 /* 7zip  module error */
 
 /* db options */
 #define CL_DB_PHISHING	    0x2
diff -dPNur clamav-0.93.3/libclamav/filetypes.c clamav-0.93.3-ds/libclamav/filetypes.c
--- clamav-0.93.3/libclamav/filetypes.c	2008-05-27 12:43:28.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/filetypes.c	2008-08-18 22:24:59.000000000 +0200
@@ -60,6 +60,7 @@
     { "CL_TYPE_ZIP",		CL_TYPE_ZIP		},
     { "CL_TYPE_BZ",		CL_TYPE_BZ		},
     { "CL_TYPE_RAR",		CL_TYPE_RAR		},
+    { "CL_TYPE_7ZIP",		CL_TYPE_7ZIP		},
     { "CL_TYPE_ARJ",		CL_TYPE_ARJ		},
     { "CL_TYPE_MSSZDD",		CL_TYPE_MSSZDD		},
     { "CL_TYPE_MSOLE2",		CL_TYPE_MSOLE2		},
diff -dPNur clamav-0.93.3/libclamav/filetypes.h clamav-0.93.3-ds/libclamav/filetypes.h
--- clamav-0.93.3/libclamav/filetypes.h	2008-04-02 22:17:27.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/filetypes.h	2008-08-18 22:24:59.000000000 +0200
@@ -47,6 +47,7 @@
     CL_TYPE_BZ,
     CL_TYPE_RAR,
     CL_TYPE_ARJ,
+    CL_TYPE_7ZIP,
     CL_TYPE_MSSZDD,
     CL_TYPE_MSOLE2,
     CL_TYPE_MSCAB,
diff -dPNur clamav-0.93.3/libclamav/filetypes_int.h clamav-0.93.3-ds/libclamav/filetypes_int.h
--- clamav-0.93.3/libclamav/filetypes_int.h	2008-04-02 22:17:28.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/filetypes_int.h	2008-08-18 22:24:59.000000000 +0200
@@ -35,6 +35,7 @@
 */
 
 static const char *ftypes_int[] = {
+  "0:0:377abcaf271c:7ZIP:CL_TYPE_ANY:CL_TYPE_7ZIP",
   "0:0:4d5a:MS-EXE/DLL:CL_TYPE_ANY:CL_TYPE_MSEXE",
   "0:0:7f454c46:ELF:CL_TYPE_ANY:CL_TYPE_ELF",
   "0:0:52617221:RAR:CL_TYPE_ANY:CL_TYPE_RAR",
diff -dPNur clamav-0.93.3/libclamav/Makefile.am clamav-0.93.3-ds/libclamav/Makefile.am
--- clamav-0.93.3/libclamav/Makefile.am	2008-05-05 15:37:53.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/Makefile.am	2008-08-18 22:26:05.000000000 +0200
@@ -21,9 +21,9 @@
 AM_CPPFLAGS = -I$(top_srcdir) -I@srcdir@/nsis -I@srcdir@/lzma
 
 if ENABLE_UNRAR
-libclamav_la_LIBADD = $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@
+libclamav_la_LIBADD = $(top_builddir)/libclamunrar_iface/libclamunrar_iface.la lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@ -lun7zip
 else
-libclamav_la_LIBADD = lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@
+libclamav_la_LIBADD = lzma/liblzma.la @LIBCLAMAV_LIBS@ @THREAD_LIBS@ -lun7zip
 endif
 
 libclamav_la_LDFLAGS = @TH_SAFE@ -version-info @LIBCLAMAV_VERSION@ -no-undefined
@@ -60,6 +60,8 @@
 	textdet.h \
 	filetypes.c \
 	filetypes.h \
+	un7zip.c \
+	un7zip.h \
 	filetypes_int.h \
 	rtf.c \
 	rtf.h \
diff -dPNur clamav-0.93.3/libclamav/others.c clamav-0.93.3-ds/libclamav/others.c
--- clamav-0.93.3/libclamav/others.c	2008-07-07 13:06:30.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/others.c	2008-08-18 22:25:00.000000000 +0200
@@ -151,6 +151,8 @@
 	    return "File size limit exceeded";
 	case CL_EMAXFILES:
 	    return "Files number limit exceeded";
+	case CL_E7ZIP:
+	    return "7zip module failure";
 	case CL_ERAR:
 	    return "RAR module failure";
 	case CL_EZIP:
diff -dPNur clamav-0.93.3/libclamav/readdb.c clamav-0.93.3-ds/libclamav/readdb.c
--- clamav-0.93.3/libclamav/readdb.c	2008-07-03 14:27:00.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/readdb.c	2008-08-18 22:28:29.000000000 +0200
@@ -690,6 +690,9 @@
 	    strncpy(buffer, ftypes_int[line], sizeof(buffer));
 	    buffer[sizeof(buffer)-1]='\0';
 	} else {
+ 	    if (line < 1) {
+ 		strcpy(buffer, ftypes_int[0]);
+ 	    } else
 	    if(!cli_dbgets(buffer, FILEBUFF, fs, dbio))
 		break;
 	    cli_chomp(buffer);
diff -dPNur clamav-0.93.3/libclamav/scanners.c clamav-0.93.3-ds/libclamav/scanners.c
--- clamav-0.93.3/libclamav/scanners.c	2008-07-03 15:31:40.000000000 +0200
+++ clamav-0.93.3-ds/libclamav/scanners.c	2008-08-18 22:29:48.000000000 +0200
@@ -99,6 +99,8 @@
 #include "libclamunrar_iface/unrar_iface.h"
 #endif
 
+#include "un7zip.h"
+
 #if defined(HAVE_READDIR_R_3) || defined(HAVE_READDIR_R_2)
 #include <limits.h>
 #include <stddef.h>
@@ -716,6 +718,41 @@
     return ret;
 }
 
+static int cli_scan7zip(int desc, cli_ctx *ctx) {
+ const char *tmpdir;
+ char *dir;
+ int ret = CL_CLEAN;
+
+
+ cli_dbgmsg("in cli_scan7zip()\n");
+
+ if((tmpdir = getenv("TMPDIR")) == NULL)
+#ifdef P_tmpdir
+     tmpdir = P_tmpdir;
+#else
+     tmpdir = "/tmp";
+#endif
+
+/* generate temporary directory */
+   dir = cli_gentemp(tmpdir);
+   if(mkdir(dir, 0700)) {
+     cli_errmsg("7zip: Can't create temporary directory %s\n", dir);
+     return CL_ETMPDIR;
+   }
+
+   if((ret = cli_un7zip(dir, desc)))
+     cli_dbgmsg("7zip: %s\n", cl_strerror(ret));
+   else
+     ret = cli_scandir(dir, ctx, 0);
+
+   if(!cli_leavetemps_flag)
+     cli_rmdirs(dir);
+
+   free(dir);
+   return ret;
+}
+
+
 static int cli_vba_scandir(const char *dirname, cli_ctx *ctx, struct uniq *U)
 {
     int ret = CL_CLEAN, i, j, fd, ofd, data_len;
@@ -1793,7 +1830,12 @@
 	    cli_warnmsg("RAR code not compiled-in\n");
 #endif
 	    break;
-
+	    
+	case CL_TYPE_7ZIP:
+	    if(SCAN_ARCHIVE)
+		ret = cli_scan7zip(desc, ctx);
+	    break;
+	    
 	case CL_TYPE_ZIP:
 	    if(SCAN_ARCHIVE && (DCONF_ARCH & ARCH_CONF_ZIP))
 		ret = cli_unzip(desc, ctx);
diff -dPNur clamav-0.93.3/libclamav/un7zip.c clamav-0.93.3-ds/libclamav/un7zip.c
--- clamav-0.93.3/libclamav/un7zip.c	1970-01-01 01:00:00.000000000 +0100
+++ clamav-0.93.3-ds/libclamav/un7zip.c	2008-08-18 22:25:00.000000000 +0200
@@ -0,0 +1,83 @@
+/*
+ *  Copyright (C) 2005 McMCC <mcmcc@mail.ru>
+ *
+ *  Support check archives 7zip
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+static char const rcsid[] = "$Id: un7zip.c,v 1.0 2005/09/05 01:40:44 mcmcc Exp $";
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/param.h>
+#include <u7zip.h>
+#include "clamav.h"
+#include "others.h"
+#include "un7zip.h"
+#include "mbox.h"
+#include "blob.h"
+
+int cli_un7zip(const char *dir, int desc)
+{
+    int fd, s_buff, res;
+    char buff[4096], uname[48];
+    const char *tmpdir;
+    FILE *out;
+
+    if((tmpdir = getenv("TMPDIR")) == NULL)
+#ifdef P_tmpdir
+        tmpdir = P_tmpdir;
+#else
+        tmpdir = "/tmp";
+#endif
+
+    sprintf(uname, "%s/szpXXXXXX", tmpdir);
+
+    if((fd = mkstemp(uname)) < 0 || (out = fdopen(fd, "w+")) == NULL)
+    {
+
+        cli_dbgmsg("cli_un7zip: can't generate temporary file %s or open descriptor %d.\n",
+                    uname, fd);
+        if(fd >= 0)
+            close(fd);
+        unlink(uname);
+        return CL_ETMPFILE;
+    }
+
+    while((s_buff=read(desc, buff, sizeof(buff))) > 0)
+    {
+        if(fwrite(buff, 1, s_buff, out) != s_buff)
+        {
+            cli_dbgmsg("cli_un7zip: can't write to file %s.\n", uname);
+            fclose(out);
+            close(fd);
+            unlink(uname);
+            return CL_EOPEN;
+        }
+    }
+    fclose(out);
+    close(fd);
+
+    res = un7zip(uname, dir, EXTRACT_7Z);
+    unlink(uname);
+    if(res) return CL_E7ZIP;
+    return CL_CLEAN;
+}
diff -dPNur clamav-0.93.3/libclamav/un7zip.h clamav-0.93.3-ds/libclamav/un7zip.h
--- clamav-0.93.3/libclamav/un7zip.h	1970-01-01 01:00:00.000000000 +0100
+++ clamav-0.93.3-ds/libclamav/un7zip.h	2008-08-18 22:25:00.000000000 +0200
@@ -0,0 +1,22 @@
+/*
+ *  Copyright (C) 2005 McMCC <mcmcc@mail.ru>
+ *
+ *  Support check archives 7zip
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+int cli_un7zip(const char *dir, int desc);
