Browse code

bb#907

git-svn: trunk@3752

Tomasz Kojm authored on 2008/04/03 06:40:00
Showing 5 changed files
... ...
@@ -1,3 +1,8 @@
1
+Wed Apr  2 22:54:23 CEST 2008 (tk)
2
+----------------------------------
3
+  * libclamav/scanners.c: cl_scandesc: check if limits is not null (bb#907)
4
+  * clamd/scanners.c: remove RAWSCAN command (bb#907)
5
+
1 6
 Wed Apr  2 16:38:36 CEST 2008 (acab)
2 7
 ------------------------------------
3 8
   * libclamav: check return codes from syscalls (bb#384)
... ...
@@ -79,12 +79,6 @@ int command(int desc, const struct cl_engine *engine, const struct cl_limits *li
79 79
 	    if(cfgopt(copt, "ExitOnOOM")->enabled)
80 80
 		return COMMAND_SHUTDOWN;
81 81
 
82
-    } else if(!strncmp(buff, CMD2, strlen(CMD2))) { /* RAWSCAN */
83
-	opt = options & ~CL_SCAN_ARCHIVE;
84
-	if(scan(buff + strlen(CMD2) + 1, NULL, engine, NULL, opt, copt, desc, TYPE_SCAN) == -2)
85
-	    if(cfgopt(copt, "ExitOnOOM")->enabled)
86
-		return COMMAND_SHUTDOWN;
87
-
88 82
     } else if(!strncmp(buff, CMD3, strlen(CMD3))) { /* QUIT */
89 83
 	return COMMAND_SHUTDOWN;
90 84
 
... ...
@@ -25,7 +25,7 @@
25 25
 #define COMMAND_SESSION 4
26 26
 
27 27
 #define CMD1 "SCAN"
28
-#define CMD2 "RAWSCAN"
28
+/* #define CMD2 "RAWSCAN" */
29 29
 #define CMD3 "QUIT" /* deprecated */
30 30
 #define CMD4 "RELOAD"
31 31
 #define CMD5 "PING"
... ...
@@ -28,9 +28,6 @@ Perform a clean exit.
28 28
 \fBSCAN file/directory\fR
29 29
 Scan a file or a directory (recursively) with archive support enabled (if not disabled in clamd.conf). A full path is required.
30 30
 .TP 
31
-\fBRAWSCAN file/directory\fR
32
-Scan a file or directory (recursively) with archive support disabled. A full path is required.
33
-.TP 
34 31
 \fBCONTSCAN file/directory\fR
35 32
 Scan file or directory (recursively) with archive support enabled and don't stop the scanning when a virus is found.
36 33
 .TP 
... ...
@@ -1928,6 +1928,10 @@ int cl_scandesc(int desc, const char **virname, unsigned long int *scanned, cons
1928 1928
     struct cl_limits l_limits;
1929 1929
     int rc;
1930 1930
 
1931
+    if(!limits) {
1932
+	cli_errmsg("cl_scandesc: limits == NULL\n");
1933
+	return CL_ENULLARG;
1934
+    }
1931 1935
     memset(&ctx, '\0', sizeof(cli_ctx));
1932 1936
     ctx.engine = engine;
1933 1937
     ctx.virname = virname;
... ...
@@ -1935,10 +1939,8 @@ int cl_scandesc(int desc, const char **virname, unsigned long int *scanned, cons
1935 1935
     ctx.options = options;
1936 1936
     ctx.found_possibly_unwanted = 0;
1937 1937
     ctx.dconf = (struct cli_dconf *) engine->dconf;
1938
-    if (limits) {
1939
-      ctx.limits = &l_limits;
1940
-      memcpy(&l_limits, limits, sizeof(struct cl_limits));
1941
-    }
1938
+    ctx.limits = &l_limits;
1939
+    memcpy(&l_limits, limits, sizeof(struct cl_limits));
1942 1940
 
1943 1941
     rc = cli_magic_scandesc(desc, &ctx);
1944 1942
     if(rc == CL_CLEAN && ctx.found_possibly_unwanted)