Skip to content

Commit 51bfd9c

Browse files
committed
Expose symlinks and hardlinks in TarInputStream and skip in TarArchive
1 parent 6c31a45 commit 51bfd9c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

ICSharpCode.SharpZipLib/Tar/TarArchive.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ public void ExtractContents(string destinationDirectory)
556556
break;
557557
}
558558

559+
if (entry.TarHeader.TypeFlag == TarHeader.LF_LINK || entry.TarHeader.TypeFlag == TarHeader.LF_SYMLINK)
560+
continue;
561+
559562
ExtractEntry(destinationDirectory, entry);
560563
}
561564
}

ICSharpCode.SharpZipLib/Tar/TarInputStream.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ public TarEntry GetNextEntry()
491491
headerBuf = this.tarBuffer.ReadBlock();
492492
} else if (header.TypeFlag != TarHeader.LF_NORMAL &&
493493
header.TypeFlag != TarHeader.LF_OLDNORM &&
494+
header.TypeFlag != TarHeader.LF_LINK &&
495+
header.TypeFlag != TarHeader.LF_SYMLINK &&
494496
header.TypeFlag != TarHeader.LF_DIR) {
495497
// Ignore things we dont understand completely for now
496498
SkipToNextEntry();

0 commit comments

Comments
 (0)