Tk Library Source Code

View Ticket
Login
Ticket UUID: 2840180
Title: Incorrect prefix/name split?
Type: Bug Version: None
Submitter: lars_h Created on: 2009-08-19 09:56:11
Subsystem: tar Assigned To: afaupell
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:19:11
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
While digging around, I encountered a discrepancy between what the tar package does and how the tar file format is documented here:
http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current

The problem is with how a filename is split between the name and prefix fields of the header, when the filename is longer than 100 characters. The tar package simply puts the last 100 characters in "name" and what comes before it in "prefix". That tar manpage rather says that the split _must happen at a slash_, and that a slash will be inserted between the prefix and name when joining the two up again.[Section "POSIX ustar Archives", description of "prefix"]

I haven't been able to actually test what actual tar utilities do with name and prefix, however; some basic attempts (at tclsh prompt) of mine of making a tarfile with one item that has name "name" and prefix "prefix" just results in tar saying "This does not look like a tar archive" :-(
User Comments: lars_h added on 2009-08-20 03:38:46:

File Added - 339816: test.tar

lars_h added on 2009-08-20 03:35:25:
After taking a break from it, I managed to make a tarball where the difference shows up (see attached file).

The tar package sees the second file as having the name
aaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbtcllib/modules/tar/pkgIndex.tcl
but a command-line tar sees it as having the name
aaaaa/bbbbaaaaa/bbbbaaaaa/bbbba/aaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbaaaaa/bbbbtcllib/modules/tar/pkgIndex.tcl
which is different in the fourth path component.

Attachments: