bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] [PATCH] fix extrac13.at with a non-working O_NOFOLLOW


From: Pino Toscano
Subject: [Bug-tar] [PATCH] fix extrac13.at with a non-working O_NOFOLLOW
Date: Tue, 17 Jan 2012 12:50:41 +0100
User-agent: KMail/1.13.7 (Linux/3.1.0-1-amd64; KDE/4.6.5; x86_64; ; )

Hi,

with tar 1.26, it looks like test extrac13.at fails when the current OS 
has a defined O_NOFOLLOW (so not undefined and manually defined to 0 
inside tar), but not working.

In particular, the case is tar on GNU/Hurd (see [1]); configure detects 
that O_NOFOLLOW does not seem to work:
| checking for working fcntl.h... no (bad O_NOFOLLOW)
the failure happens at line 41 of extrac13.at ("tar --overwrite -xf 
archive.tar ...."): the open() used for writing "dst2/file1" fails
because the file exist already, while it should have been removed
earlier (by the "maybe_recoverable" in "extract_file").

Attached there is my attempt in fixing the issue (of course there's also 
the non-working O_NOFOLLOW on GNU/Hurd, but that's another issue),
making the fstatat() check in "open_output_file" be done even in case 
O_NOFOLLOW is properly defined but detected as not working by the 
configure check.

[1] 
https://buildd.debian.org/status/fetch.php?pkg=tar&arch=hurd-i386&ver=1.26-4&stamp=1325314847

Thanks,
-- 
Pino Toscano

Attachment: tar-no-O_NOFOLLOW.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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