[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. 99ae9353f6834da0cb73f59f4b32d1f0ae1263fa

Stephen Gran steve at lobefin.net
Thu Sep 4 12:37:04 UTC 2008


The following commit has been merged in the debian/unstable branch:
commit 73e070029641c4a7a81ab9c4655588ed65e9ee74
Author: Stephen Gran <steve at lobefin.net>
Date:   Thu Sep 4 13:25:48 2008 +0100

    Revert "bb#907"
    
    This reverts commit 6d553b439965758eb4f039b465c94541799d21bc.

diff --git a/ChangeLog b/ChangeLog
index e69efae..ea1bee6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,3 @@
-Wed Apr  2 22:54:23 CEST 2008 (tk)
-----------------------------------
-  * libclamav/scanners.c: cl_scandesc: check if limits is not null (bb#907)
-  * clamd/scanners.c: remove RAWSCAN command (bb#907)
-
 Wed Apr  2 16:34:43 CEST 2008 (tk)
 ----------------------------------
   * libclamav: update copyrights and stick more files to GPLv2; move and add
diff --git a/clamd/session.c b/clamd/session.c
index 2d1cf64..efdc35e 100644
--- a/clamd/session.c
+++ b/clamd/session.c
@@ -79,6 +79,12 @@ int command(int desc, const struct cl_engine *engine, const struct cl_limits *li
 	    if(cfgopt(copt, "ExitOnOOM")->enabled)
 		return COMMAND_SHUTDOWN;
 
+    } else if(!strncmp(buff, CMD2, strlen(CMD2))) { /* RAWSCAN */
+	opt = options & ~CL_SCAN_ARCHIVE;
+	if(scan(buff + strlen(CMD2) + 1, NULL, engine, NULL, opt, copt, desc, TYPE_SCAN) == -2)
+	    if(cfgopt(copt, "ExitOnOOM")->enabled)
+		return COMMAND_SHUTDOWN;
+
     } else if(!strncmp(buff, CMD3, strlen(CMD3))) { /* QUIT */
 	return COMMAND_SHUTDOWN;
 
diff --git a/clamd/session.h b/clamd/session.h
index 467c3e5..279803c 100644
--- a/clamd/session.h
+++ b/clamd/session.h
@@ -25,7 +25,7 @@
 #define COMMAND_SESSION 4
 
 #define CMD1 "SCAN"
-/* #define CMD2 "RAWSCAN" */
+#define CMD2 "RAWSCAN"
 #define CMD3 "QUIT" /* deprecated */
 #define CMD4 "RELOAD"
 #define CMD5 "PING"
diff --git a/docs/man/clamd.8.in b/docs/man/clamd.8.in
index 905f38d..293cc87 100644
--- a/docs/man/clamd.8.in
+++ b/docs/man/clamd.8.in
@@ -28,6 +28,9 @@ Perform a clean exit.
 \fBSCAN file/directory\fR
 Scan a file or a directory (recursively) with archive support enabled (if not disabled in clamd.conf). A full path is required.
 .TP 
+\fBRAWSCAN file/directory\fR
+Scan a file or directory (recursively) with archive support disabled. A full path is required.
+.TP 
 \fBCONTSCAN file/directory\fR
 Scan file or directory (recursively) with archive support enabled and don't stop the scanning when a virus is found.
 .TP 
diff --git a/libclamav/scanners.c b/libclamav/scanners.c
index f9c93d1..a7fb895 100644
--- a/libclamav/scanners.c
+++ b/libclamav/scanners.c
@@ -1964,10 +1964,6 @@ int cl_scandesc(int desc, const char **virname, unsigned long int *scanned, cons
     struct cl_limits l_limits;
     int rc;
 
-    if(!limits) {
-	cli_errmsg("cl_scandesc: limits == NULL\n");
-	return CL_ENULLARG;
-    }
     memset(&ctx, '\0', sizeof(cli_ctx));
     ctx.engine = engine;
     ctx.virname = virname;
@@ -1975,8 +1971,10 @@ int cl_scandesc(int desc, const char **virname, unsigned long int *scanned, cons
     ctx.options = options;
     ctx.found_possibly_unwanted = 0;
     ctx.dconf = (struct cli_dconf *) engine->dconf;
-    ctx.limits = &l_limits;
-    memcpy(&l_limits, limits, sizeof(struct cl_limits));
+    if (limits) {
+      ctx.limits = &l_limits;
+      memcpy(&l_limits, limits, sizeof(struct cl_limits));
+    }
 
     rc = cli_magic_scandesc(desc, &ctx);
     if(rc == CL_CLEAN && ctx.found_possibly_unwanted)

-- 
Debian repository for ClamAV



More information about the Pkg-clamav-commits mailing list