Urgent.News

What's breaking now, across thousands of outlets.

Tech

The hardest tarball

The "hardest tarball" is a unique archive created through a single GNU tar command using three files: file, an empty file, and a hard link to the file. This archive can be extracted in eight distinct ways using various tar utilities and libraries. The key element is the renaming of the hard link to "café," which triggers the creation of a pax header to store the file name as UTF-8.

The pax header contains a size=512 record, overriding the default size=0 from the hard link. This size is exactly the size of a tar header, leading to confusion about whether the 512 bytes belong to the hard link or the empty file. The archive's extraction results vary depending on the implementation, with some systems writing the 512 bytes into the hard link, while others skip over them.

This archive demonstrates the complexities and nuances of handling hard links and UTF-8 encoding in tar archives, resulting in a variety of unexpected outcomes when extracted.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Also reported by 1 other outlet

Read the original at stoppels.ch →

More in Tech

More from Tuesday 10 November →