mirror of
https://github.com/sheumann/hush.git
synced 2025-01-13 21:31:51 +00:00
Check for archive errors even for files we aren't extracting.
This commit is contained in:
parent
768a2340b5
commit
ab8f9e286b
@ -530,13 +530,15 @@ static int readTarFile(const char* tarName, int extractFlag, int listFlag,
|
|||||||
/* Skip funky extra GNU headers that precede long files */
|
/* Skip funky extra GNU headers that precede long files */
|
||||||
if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) {
|
if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) {
|
||||||
skipNextHeaderFlag=TRUE;
|
skipNextHeaderFlag=TRUE;
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( skipNextHeaderFlag == TRUE ) {
|
if ( skipNextHeaderFlag == TRUE ) {
|
||||||
skipNextHeaderFlag=FALSE;
|
skipNextHeaderFlag=FALSE;
|
||||||
errorMsg(name_longer_than_foo, NAME_SIZE);
|
errorMsg(name_longer_than_foo, NAME_SIZE);
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
continue;
|
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
|
* the extractFlag set to FALSE, so the junk in the tarball
|
||||||
* is properly skipped over */
|
* is properly skipped over */
|
||||||
if ( header.type==REGTYPE || header.type==REGTYPE0 ) {
|
if ( header.type==REGTYPE || header.type==REGTYPE0 ) {
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
}
|
}
|
||||||
skipFlag=TRUE;
|
skipFlag=TRUE;
|
||||||
break;
|
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 */
|
/* There are not the droids you're looking for, move along */
|
||||||
if (skipFlag == TRUE) {
|
if (skipFlag == TRUE) {
|
||||||
if ( header.type==REGTYPE || header.type==REGTYPE0 )
|
if ( header.type==REGTYPE || header.type==REGTYPE0 )
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
tar.c
12
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 */
|
/* Skip funky extra GNU headers that precede long files */
|
||||||
if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) {
|
if ( (header.type == GNULONGNAME) || (header.type == GNULONGLINK) ) {
|
||||||
skipNextHeaderFlag=TRUE;
|
skipNextHeaderFlag=TRUE;
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( skipNextHeaderFlag == TRUE ) {
|
if ( skipNextHeaderFlag == TRUE ) {
|
||||||
skipNextHeaderFlag=FALSE;
|
skipNextHeaderFlag=FALSE;
|
||||||
errorMsg(name_longer_than_foo, NAME_SIZE);
|
errorMsg(name_longer_than_foo, NAME_SIZE);
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
continue;
|
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
|
* the extractFlag set to FALSE, so the junk in the tarball
|
||||||
* is properly skipped over */
|
* is properly skipped over */
|
||||||
if ( header.type==REGTYPE || header.type==REGTYPE0 ) {
|
if ( header.type==REGTYPE || header.type==REGTYPE0 ) {
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
}
|
}
|
||||||
skipFlag=TRUE;
|
skipFlag=TRUE;
|
||||||
break;
|
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 */
|
/* There are not the droids you're looking for, move along */
|
||||||
if (skipFlag == TRUE) {
|
if (skipFlag == TRUE) {
|
||||||
if ( header.type==REGTYPE || header.type==REGTYPE0 )
|
if ( header.type==REGTYPE || header.type==REGTYPE0 )
|
||||||
tarExtractRegularFile(&header, FALSE, FALSE);
|
if (tarExtractRegularFile(&header, FALSE, FALSE) == FALSE)
|
||||||
|
errorFlag = TRUE;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user