bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] prefix field cann't trusted as part of path


From: Paul Eggert
Subject: Re: [Bug-tar] prefix field cann't trusted as part of path
Date: Sun, 15 May 2011 09:16:07 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10

Thanks, but unfortunately that patch seems to conflict with the POSIX standard
<http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06>,
which says:

> A new pathname shall be formed, if prefix is not an empty string (its first 
> character is not NUL),
> by concatenating prefix (up to the first NUL character), a <slash> character, 
> and name;
> otherwise, name is used alone.

So a slash is required if the name field is empty.

But rather than worry too much about the standard, the main question is:
why is this change needed?  Ordinary 'tar' never produces such a header,
as the header contradicts itself: it claims to be a non-directory, but its file
name ends with "/".  If this never happens (except when tar files are
corrupted), why does it matter whether GNU tar treats the file as a
directory or as some other file type?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]