Archive member
An archive member is an individual stored entry with its own metadata and, where applicable, payload, whose name need not be unique within an archive.
GNU tar permits repeated names. Disk extraction can leave the last version; --to-stdout concatenates selected payloads in archive order. Neither identifies the required generation. [1] [2]
TarFile.getmember(name) selects the last occurrence; getmembers() preserves order. Passing a TarInfo to extractfile() retains entry identity. A controlled name-relookup loop returned B+B instead of A+B. [3] [4]
Selected reads do not verify every member. In USTAR controls, --occurrence=1 returned an intact first file despite a damaged later header. Full listing detected header damage but accepted changed payload: the checksum covers the header, not file data. [5] [6]
On CPython 3.12.3, ZIP testzip() missed a damaged first duplicate; reading each ZipInfo found it. This reproduces issue 156539. The tested CLI also returned status 0 when reporting corruption with distinct names. [7] [8]
An intact gzip stream can hold two terminated TARs while default TAR reading stops at the first. Tested continuation modes reached later entries, but Python ignore_zeros also skipped an invalid header. Recovery needs an independent inventory. [9]
A TAR hard-link entry can depend on another name. In target-first USTAR tests, selected extraction reused a stale disk target without error in GNU tar 1.35 and both Python builds. Filters, status and matching size did not establish the required bytes. [10] [11]
With GNU tar 1.35, --skip-old-files preserved stale linked bytes during full extraction with status 0. Alias-only extraction did so even with --keep-old-files. [12] [11]
Relations
- related
- Backup manifest, Restore test, Compression dictionary, Cryptographic hash function, Gzip, ZIP archive, Hard link, NumPy NPZ archive
Limitations
- CPIO crc covers payload bytes, not the name and permissions. Controlled metadata changes preserved the data sum and payload hash while changing the extracted name or mode. Recovery checks must include required metadata. [13, 14, 15]
- Archive EOF can be a parser boundary rather than exhaustion of the physical input. The libarchive v3.7.2 CPIO reader returns archive EOF at TRAILER!!!; this event alone does not validate trailing input. [16]
- A BagIt payload manifest records paths and content digests, not POSIX permission bits. Those fields alone cannot verify a required mode; retain and check required filesystem metadata separately. [17]
Citations
- GNU tar 1.35: appending files and repeated member names
- GNU tar 1.35: Writing to Standard Output
- Python 3.12 tarfile: getmember, getmembers and extractfile
- Hesela: measured TAR member selection in archive recovery
- Hesela: twelve measured TAR read-coverage operations
- GNU tar 1.35: Basic Tar Format, header checksum
- CPython issue 156539: testzip skips earlier duplicate members (reported August 2026)
- Hesela: controlled ZIP entry-identity and CLI-status observations
- Hesela: TAR boundaries after complete gzip validation, 48 reader observations
- GNU tar 1.35: Hard Links
- Hesela: selected TAR hard-link restore, complete observations and reproduction
- GNU tar 1.35: Keep Old Files
- Linux v6.8 initramfs format: c_magic and c_chksum
- libarchive v3.7.2 cpio(5): New CRC Format and Bugs
- Hesela: CPIO checksum scope, reader policy and failure signalling
- libarchive v3.7.2 CPIO reader: archive_read_format_cpio_read_header and TRAILER!!!
- RFC 8493: payload manifests (section 2.1.3), completeness and validity (section 3)
Sources & caveats
- GNU tar 1.35 manual and Python 3.12 documentation; measured GNU tar 1.35 / Python 3.12.3. Literal regular-file names only; no hostile-archive security guarantee.
- Reproduction: https://hesela.dev/research/tar-member-selection.py ; observations: https://hesela.dev/research/tar-member-selection.json
- Coverage extension: https://hesela.dev/research/tar-read-coverage.py ; observations: https://hesela.dev/research/tar-read-coverage.json . Plain USTAR only; command outcomes are not a trace of physical reads.
- ZIP reproduction: https://hesela.dev/research/zip-validation-identity.py ; observations: https://hesela.dev/research/zip-validation-identity.json . Six ZIP_STORED fixtures; CPython 3.12.3 only.
- Boundary comparison: GNU tar 1.35, gzip 1.12 and CPython 3.12.3; eight synthetic fixtures and 48 reader operations. Canonical code, results and tests: https://hesela.dev/research/tar-boundary/README.md
- Five synthetic USTAR fixtures, eleven operations per fixture, CPython 3.12.3 and 3.12.15 with one GNU tar 1.35 binary. Exact payload and live device/inode comparisons; not independent reliability samples. https://hesela.dev/research/tar-hardlink-selection/observation-system.json
- Twelve additional overwrite-policy controls, exactly replayed on the same GNU tar 1.35 binary and host; synthetic files, not a failure-rate estimate. https://hesela.dev/research/tar-hardlink-selection/overwrite-observations.json
- CPIO: eleven synthetic regular-file fixtures, 55 native reader operations per retained capture and same-host replays. GNU cpio 2.15 / libarchive 3.7.2; not a field-rate or kernel-boot experiment. https://hesela.dev/research/cpio-checksum-contract/README.md