... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Thu Dec 30 15:02:05 CET 2010 (tk) |
|
2 |
+--------------------------------- |
|
3 |
+ * libclamav/filetypes.c: improve detection of tar files |
|
4 |
+ |
|
1 | 5 |
Wed Dec 29 14:36:46 CET 2010 (tk) |
2 | 6 |
--------------------------------- |
3 | 7 |
* libclamav/scanners.c: improve scanning of mail files in raw mode (bb#2244) |
... | ... |
@@ -163,6 +163,17 @@ cli_file_t cli_filetype2(fmap_t *map, const struct cl_engine *engine) |
163 | 163 |
|
164 | 164 |
ret = cli_filetype(buff, bread, engine); |
165 | 165 |
|
166 |
+ if(ret == CL_TYPE_BINARY_DATA) { |
|
167 |
+ switch(is_tar(buff, bread)) { |
|
168 |
+ case 1: |
|
169 |
+ cli_dbgmsg("Recognized old fashioned tar file\n"); |
|
170 |
+ return CL_TYPE_OLD_TAR; |
|
171 |
+ case 2: |
|
172 |
+ cli_dbgmsg("Recognized POSIX tar file\n"); |
|
173 |
+ return CL_TYPE_POSIX_TAR; |
|
174 |
+ } |
|
175 |
+ } |
|
176 |
+ |
|
166 | 177 |
if(ret >= CL_TYPE_TEXT_ASCII && ret <= CL_TYPE_BINARY_DATA) { |
167 | 178 |
/* HTML files may contain special characters and could be |
168 | 179 |
* misidentified as BINARY_DATA by cli_filetype() |
... | ... |
@@ -234,18 +245,5 @@ cli_file_t cli_filetype2(fmap_t *map, const struct cl_engine *engine) |
234 | 234 |
} |
235 | 235 |
} |
236 | 236 |
|
237 |
- if(ret == CL_TYPE_BINARY_DATA) { |
|
238 |
- switch(is_tar(buff, bread)) { |
|
239 |
- case 1: |
|
240 |
- ret = CL_TYPE_OLD_TAR; |
|
241 |
- cli_dbgmsg("Recognized old fashioned tar file\n"); |
|
242 |
- break; |
|
243 |
- case 2: |
|
244 |
- ret = CL_TYPE_POSIX_TAR; |
|
245 |
- cli_dbgmsg("Recognized POSIX tar file\n"); |
|
246 |
- break; |
|
247 |
- } |
|
248 |
- } |
|
249 |
- |
|
250 | 237 |
return ret; |
251 | 238 |
} |