diff options
author | Matt Kraai <kraai@debian.org> | 2000-11-18 01:28:57 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2000-11-18 01:28:57 +0000 |
commit | ab8f9e286b15e043099d5b28b650e57823f8d273 (patch) | |
tree | 6250de1e3ab413d388d1198da72cd7fb76558aec | |
parent | 768a2340b557f01738bf5944463a6fc4d70f0b21 (diff) | |
download | busybox-w32-ab8f9e286b15e043099d5b28b650e57823f8d273.tar.gz busybox-w32-ab8f9e286b15e043099d5b28b650e57823f8d273.tar.bz2 busybox-w32-ab8f9e286b15e043099d5b28b650e57823f8d273.zip |
Check for archive errors even for files we aren't extracting.
-rw-r--r-- | archival/tar.c | 12 | ||||
-rw-r--r-- | tar.c | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/archival/tar.c b/archival/tar.c index 07c0e7105..a845df166 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -530,13 +530,15 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag, | |||
530 | /* Skip funky extra GNU headers that precede long files */ | 530 | /* Skip funky extra GNU headers that precede long files */ |
531 | if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) { | 531 | if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) { |
532 | skipNextHeaderFlag=TRUE; | 532 | skipNextHeaderFlag=TRUE; |
533 | tarExtractRegularFile(&header, FALSE, FALSE); | 533 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
534 | errorFlag = TRUE; | ||
534 | continue; | 535 | continue; |
535 | } | 536 | } |
536 | if ( skipNextHeaderFlag == TRUE ) { | 537 | if ( skipNextHeaderFlag == TRUE ) { |
537 | skipNextHeaderFlag=FALSE; | 538 | skipNextHeaderFlag=FALSE; |
538 | errorMsg(name_longer_than_foo, NAME_SIZE); | 539 | errorMsg(name_longer_than_foo, NAME_SIZE); |
539 | tarExtractRegularFile(&header, FALSE, FALSE); | 540 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
541 | errorFlag = TRUE; | ||
540 | continue; | 542 | continue; |
541 | } | 543 | } |
542 | 544 | ||
@@ -555,7 +557,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag, | |||
555 | * the extractFlag set to FALSE, so the junk in the tarball | 557 | * the extractFlag set to FALSE, so the junk in the tarball |
556 | * is properly skipped over */ | 558 | * is properly skipped over */ |
557 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) { | 559 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) { |
558 | tarExtractRegularFile(&header, FALSE, FALSE); | 560 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
561 | errorFlag = TRUE; | ||
559 | } | 562 | } |
560 | skipFlag=TRUE; | 563 | skipFlag=TRUE; |
561 | break; | 564 | break; |
@@ -583,7 +586,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag, | |||
583 | /* There are not the droids you're looking for, move along */ | 586 | /* There are not the droids you're looking for, move along */ |
584 | if (skipFlag == TRUE) { | 587 | if (skipFlag == TRUE) { |
585 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) | 588 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) |
586 | tarExtractRegularFile(&header, FALSE, FALSE); | 589 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
590 | errorFlag = TRUE; | ||
587 | continue; | 591 | continue; |
588 | } | 592 | } |
589 | } | 593 | } |
@@ -530,13 +530,15 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag, | |||
530 | /* Skip funky extra GNU headers that precede long files */ | 530 | /* Skip funky extra GNU headers that precede long files */ |
531 | if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) { | 531 | if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) { |
532 | skipNextHeaderFlag=TRUE; | 532 | skipNextHeaderFlag=TRUE; |
533 | tarExtractRegularFile(&header, FALSE, FALSE); | 533 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
534 | errorFlag = TRUE; | ||
534 | continue; | 535 | continue; |
535 | } | 536 | } |
536 | if ( skipNextHeaderFlag == TRUE ) { | 537 | if ( skipNextHeaderFlag == TRUE ) { |
537 | skipNextHeaderFlag=FALSE; | 538 | skipNextHeaderFlag=FALSE; |
538 | errorMsg(name_longer_than_foo, NAME_SIZE); | 539 | errorMsg(name_longer_than_foo, NAME_SIZE); |
539 | tarExtractRegularFile(&header, FALSE, FALSE); | 540 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
541 | errorFlag = TRUE; | ||
540 | continue; | 542 | continue; |
541 | } | 543 | } |
542 | 544 | ||
@@ -555,7 +557,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag, | |||
555 | * the extractFlag set to FALSE, so the junk in the tarball | 557 | * the extractFlag set to FALSE, so the junk in the tarball |
556 | * is properly skipped over */ | 558 | * is properly skipped over */ |
557 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) { | 559 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) { |
558 | tarExtractRegularFile(&header, FALSE, FALSE); | 560 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
561 | errorFlag = TRUE; | ||
559 | } | 562 | } |
560 | skipFlag=TRUE; | 563 | skipFlag=TRUE; |
561 | break; | 564 | break; |
@@ -583,7 +586,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag, | |||
583 | /* There are not the droids you're looking for, move along */ | 586 | /* There are not the droids you're looking for, move along */ |
584 | if (skipFlag == TRUE) { | 587 | if (skipFlag == TRUE) { |
585 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) | 588 | if ( header.type==REGTYPE || header.type==REGTYPE0 ) |
586 | tarExtractRegularFile(&header, FALSE, FALSE); | 589 | if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE) |
590 | errorFlag = TRUE; | ||
587 | continue; | 591 | continue; |
588 | } | 592 | } |
589 | } | 593 | } |