From ab8f9e286b15e043099d5b28b650e57823f8d273 Mon Sep 17 00:00:00 2001
From: Matt Kraai <kraai@debian.org>
Date: Sat, 18 Nov 2000 01:28:57 +0000
Subject: Check for archive errors even for files we aren't extracting.

---
 archival/tar.c | 12 ++++++++----
 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,
 		/* Skip funky extra GNU headers that precede long files */
 		if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) {
 			skipNextHeaderFlag=TRUE;
-			tarExtractRegularFile(&header, FALSE, FALSE);
+			if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+				errorFlag = TRUE;
 			continue;
 		}
 		if ( skipNextHeaderFlag == TRUE ) { 
 			skipNextHeaderFlag=FALSE;
 			errorMsg(name_longer_than_foo, NAME_SIZE); 
-			tarExtractRegularFile(&header, FALSE, FALSE);
+			if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+				errorFlag = TRUE;
 			continue;
 		}
 
@@ -555,7 +557,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
 					 * the extractFlag set to FALSE, so the junk in the tarball
 					 * is properly skipped over */
 					if ( header.type==REGTYPE || header.type==REGTYPE0 ) {
-							tarExtractRegularFile(&header, FALSE, FALSE);
+						if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+							errorFlag = TRUE;
 					}
 					skipFlag=TRUE;
 					break;
@@ -583,7 +586,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
 			/* There are not the droids you're looking for, move along */
 			if (skipFlag == TRUE) {
 				if ( header.type==REGTYPE || header.type==REGTYPE0 )
-						tarExtractRegularFile(&header, FALSE, FALSE);
+					if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+						errorFlag = TRUE;
 				continue;
 			}
 		}
diff --git a/tar.c b/tar.c
index 07c0e7105..a845df166 100644
--- a/tar.c
+++ b/tar.c
@@ -530,13 +530,15 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
 		/* Skip funky extra GNU headers that precede long files */
 		if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) {
 			skipNextHeaderFlag=TRUE;
-			tarExtractRegularFile(&header, FALSE, FALSE);
+			if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+				errorFlag = TRUE;
 			continue;
 		}
 		if ( skipNextHeaderFlag == TRUE ) { 
 			skipNextHeaderFlag=FALSE;
 			errorMsg(name_longer_than_foo, NAME_SIZE); 
-			tarExtractRegularFile(&header, FALSE, FALSE);
+			if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+				errorFlag = TRUE;
 			continue;
 		}
 
@@ -555,7 +557,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
 					 * the extractFlag set to FALSE, so the junk in the tarball
 					 * is properly skipped over */
 					if ( header.type==REGTYPE || header.type==REGTYPE0 ) {
-							tarExtractRegularFile(&header, FALSE, FALSE);
+						if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+							errorFlag = TRUE;
 					}
 					skipFlag=TRUE;
 					break;
@@ -583,7 +586,8 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
 			/* There are not the droids you're looking for, move along */
 			if (skipFlag == TRUE) {
 				if ( header.type==REGTYPE || header.type==REGTYPE0 )
-						tarExtractRegularFile(&header, FALSE, FALSE);
+					if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
+						errorFlag = TRUE;
 				continue;
 			}
 		}
-- 
cgit v1.2.3-55-g6feb