Browse code

cleanup

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@894 77e5149b-7576-45b1-b177-96237e5ba77b

Tomasz Kojm authored on 2004/09/18 09:14:00
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Sep 18 02:09:52 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav/scanners.c: honour return code of cli_mbox
4
+
1 5
 Sat Sep 18 01:13:21 CEST 2004 (tk)
2 6
 ----------------------------------
3 7
   * libclamav: add support for new signature format (*.ndb; not yet documented)
... ...
@@ -24,6 +24,9 @@
24 24
 # for facility names. Default is LOG_LOCAL6.
25 25
 #LogFacility LOG_MAIL
26 26
 
27
+# This option allows you to save the process identifier of the daemon
28
+#PidFile /var/run/freshclam.pid
29
+
27 30
 # By default when freshclam is started by root it drops privileges and
28 31
 # switches to the "clamav" user. You can change this behaviour here.
29 32
 #DatabaseOwner clamav
... ...
@@ -104,8 +104,10 @@ static long int cli_caloff(const char *offstr, int fd)
104 104
 	    return -1;
105 105
 	}
106 106
 	lseek(fd, 0, SEEK_SET);
107
-	if(cli_peheader(fd, &peinfo))
107
+	if(cli_peheader(fd, &peinfo)) {
108
+	    lseek(fd, n, SEEK_SET);
108 109
 	    return -1;
110
+	}
109 111
 	free(peinfo.section);
110 112
 	lseek(fd, n, SEEK_SET);
111 113
 	return peinfo.ep + atoi(offstr + 3);
... ...
@@ -115,8 +117,10 @@ static long int cli_caloff(const char *offstr, int fd)
115 115
 	    return -1;
116 116
 	}
117 117
 	lseek(fd, 0, SEEK_SET);
118
-	if(cli_peheader(fd, &peinfo))
118
+	if(cli_peheader(fd, &peinfo)) {
119
+	    lseek(fd, n, SEEK_SET);
119 120
 	    return -1;
121
+	}
120 122
 	lseek(fd, n, SEEK_SET);
121 123
 
122 124
 	if(sscanf(offstr, "S%d+%ld", &n, &offset) != 2)
... ...
@@ -235,7 +239,6 @@ int cli_scandesc(int desc, const char **virname, long int *scanned, const struct
235 235
 	    free(buffer);
236 236
 	    free(partcnt);
237 237
 	    free(partoff);
238
-
239 238
 	    return CL_VIRUS;
240 239
 
241 240
 	} else if(otfrec && ret >= CL_TYPENO) {
... ...
@@ -1087,6 +1087,7 @@ static int cli_scanscrenc(int desc, const char **virname, long int *scanned, con
1087 1087
     free(tempname);
1088 1088
     return ret;
1089 1089
 }
1090
+
1090 1091
 static int cli_scanmail(int desc, const char **virname, long int *scanned, const struct cl_node *root, const struct cl_limits *limits, unsigned int options, int *arec, int *mrec)
1091 1092
 {
1092 1093
 	const char *tmpdir;
... ...
@@ -1113,8 +1114,8 @@ static int cli_scanmail(int desc, const char **virname, long int *scanned, const
1113 1113
 	/*
1114 1114
 	 * Extract the attachments into the temporary directory
1115 1115
 	 */
1116
-	ret = cli_mbox(dir, desc, options);
1117
-	/* FIXME: check mbox return code */
1116
+	if((ret = cli_mbox(dir, desc, options)))
1117
+	    return ret;
1118 1118
 
1119 1119
 	ret = cli_scandir(dir, virname, scanned, root, limits, options, arec, mrec);
1120 1120