Hacker News new | ask | show | jobs
by yjftsjthsd-h 759 days ago
The first field in the tar header is

    char name[100];
(See https://man.archlinux.org/man/tar.5.en )

So anything that will write an absolute path there, including literally opening it in a text editor and replacing the path by hand because that whole header is just fixed length ASCII with null terminated strings.

(I mean I assume the tar(1) command can do it too but you don't need that, the format is dead simple, if weird.)

1 comments

It's a good exercise to open one of these files in hexdump or something to get a feel for what's really going on inside... but yeah, GNU tar has -P / --absolute-names to just create them with leading slashes.