On Mon, Feb 28, 2011 at 11:48:44PM +0100, Ralf Friedl wrote: > Alexander Shishkin wrote: > >Currently, tar will add members with names starting with > >the prefixes to an archive unmodified, and will then refuse > >to extract from such archive. However, GNU tar will strip > >these prefixes upon creating the archive and reading from > >it. > Is there a use case for this?
There's a bug in current implementation that I'm trying to fix, that's it. Creating a broken archive (that GNU tar is still able to unpack, though) and then failing to unpack it seems a good enough reason for me. > Instead of "tar c ../path" you can use "tar cC .. path" to crate > that archive. Yes, that bit works, of course. > The patch looses functionality. The old code would detect > ./../../etc, the new code would not. Detect and bail, yes. > The behavior of GNU tar is actually different: It will strip > everything up to the last ../: > $ tar c ./coreutils/../../../../../../etc/passwd > /dev/null > tar: Removing leading `./coreutils/../../../../../../' from member names That's true, thanks for pointing this out, I didn't know that. > In addition, with the option t GNU tar claims to remove the leading > path, but displays the full path: > $ tar cP coreutils/../../../../../../../etc/passwd | tar t > tar: Removing leading `coreutils/../../../../../../../' from member names > coreutils/../../../../../../../etc/passwd Ok, I'm not sure if this is actually a useful feature, but thanks for pointing it out. P.S. There's something wrong with your email client, I wasn't even in CC in your reply. Regards, -- Alex _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox