Patch for stdlib/erl_tar.erl

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Patch for stdlib/erl_tar.erl

Erik Reitsma (RY/ETM)-2

While using systools:make_tar/1 I found that the implementation of tar is incorrect. The problem occurs when the file name (including path) is more than 100 bytes long. The tar format has a provision for that case, but then the tar file should indicate that it has the new format. This is indicated using the 'magic' field. The value of this field should be "ustar" followed by a zero. In the current implementation the magic field is filled with zeros, so a regular tar assumes that the file has an old format, and part of the path is lost when untarring.

I have attached the patch.

Good to see the mailing list back online, b.t.w.


Erik Reitsma
System Engineer, Technology Strategies
Service Network and Applications

Ericsson Telecommunicatie B.V.
Research and Development
Tel.: +31 161 242582
Fax: +31 161 242206

-------------- next part --------------
A non-text attachment was scrubbed...
Name: erl_tar.erl.patch
Type: application/octet-stream
Size: 870 bytes
Desc: not available
URL: <>