Browse code

return with CL_EFORMAT instead of CL_EDSIG

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

Tomasz Kojm authored on 2004/09/13 08:43:45
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Sep 13 01:41:48 CEST 2004 (tk)
2
+----------------------------------
3
+  * libclamav/untar.c: return with CL_EFORMAT instead of CL_EDSIG
4
+
1 5
 Sun Sep 12 20:54:05 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/untar.c:	Now builds with configure --enable-debug
... ...
@@ -63,6 +63,7 @@ extern "C"
63 63
 #define CL_EMD5		-10 /* MD5 verification error */
64 64
 #define CL_EDSIG	-11 /* digital signature verification error */
65 65
 #define CL_EIO		-12 /* general I/O error */
66
+#define CL_EFORMAT	-13 /* bad format or broken file */
66 67
 
67 68
 /* options */
68 69
 #define CL_RAW		0
... ...
@@ -20,6 +20,9 @@
20 20
  *
21 21
  * Change History:
22 22
  * $Log: untar.c,v $
23
+ * Revision 1.8  2004/09/12 23:43:45  kojm
24
+ * return with CL_EFORMAT instead of CL_EDSIG
25
+ *
23 26
  * Revision 1.7  2004/09/12 19:51:59  nigelhorne
24 27
  * Now builds with --enable-debug
25 28
  *
... ...
@@ -42,7 +45,7 @@
42 42
  * First draft
43 43
  *
44 44
  */
45
-static	char	const	rcsid[] = "$Id: untar.c,v 1.7 2004/09/12 19:51:59 nigelhorne Exp $";
45
+static	char	const	rcsid[] = "$Id: untar.c,v 1.8 2004/09/12 23:43:45 kojm Exp $";
46 46
 
47 47
 #include <stdio.h>
48 48
 #include <errno.h>
... ...
@@ -132,7 +135,7 @@ cli_untar(const char *dir, int desc)
132 132
 			magic[6] = '\0';
133 133
 			if(strcmp(magic, "ustar ") != 0) {
134 134
 				cli_errmsg("Incorrect magic number in tar header\n");
135
-				return CL_EDSIG;
135
+				return CL_EFORMAT;
136 136
 			}
137 137
 
138 138
 			type = block[156];
... ...
@@ -203,7 +206,7 @@ cli_untar(const char *dir, int desc)
203 203
 			if(size < 0) {
204 204
 				cli_errmsg("Invalid size in tar header\n");
205 205
 				fclose(outfile);
206
-				return CL_EDSIG;
206
+				return CL_EFORMAT;
207 207
 			}
208 208
 		} else { /* write or continue writing file contents */
209 209
 			const int nbytes = size>512? 512:size;
... ...
@@ -220,5 +223,5 @@ cli_untar(const char *dir, int desc)
220 220
 	}
221 221
 	if(outfile)
222 222
 		fclose(outfile);
223
-	return CL_CLEAN;
223
+	return 0;
224 224
 }