Handle GNU tar files

git-svn: trunk@970
remotes/push_mirror/metadata
Nigel Horne 21 years ago
parent 2050a6b396
commit b6c51e0dce
  1. 4
      clamav-devel/ChangeLog
  2. 13
      clamav-devel/libclamav/untar.c

@ -1,3 +1,7 @@
Mon Oct 4 14:48:16 BST 2004 (njh)
----------------------------------
* libclamav/untar.c: Handle GNU tar files
Mon Oct 4 13:38:23 BST 2004 (njh)
----------------------------------
* clamav-milter: Fix mails containing viruses being kept twice in

@ -20,6 +20,9 @@
*
* Change History:
* $Log: untar.c,v $
* Revision 1.13 2004/10/04 13:46:50 nigelhorne
* Handle GNU tar files
*
* Revision 1.12 2004/10/04 10:53:15 nigelhorne
* Handle tar files less than 512 bytes
*
@ -57,7 +60,7 @@
* First draft
*
*/
static char const rcsid[] = "$Id: untar.c,v 1.12 2004/10/04 10:53:15 nigelhorne Exp $";
static char const rcsid[] = "$Id: untar.c,v 1.13 2004/10/04 13:46:50 nigelhorne Exp $";
#include <stdio.h>
#include <errno.h>
@ -147,10 +150,10 @@ cli_untar(const char *dir, int desc)
break;
/* Notice assumption that BLOCKSIZE > 262 */
strncpy(magic, block+257, 6);
magic[6] = '\0';
if(strcmp(magic, "ustar ") != 0) {
cli_dbgmsg("Incorrect magic number in tar header\n");
strncpy(magic, block+257, 5);
magic[5] = '\0';
if(strcmp(magic, "ustar") != 0) {
cli_dbgmsg("Incorrect magic string '%s' in tar header\n", magic);
return CL_EFORMAT;
}

Loading…
Cancel
Save