Source: tar
Version: 1.26+dfsg-7
Severity: important
Tags: patch fixed-upstream
User: debian-h...@lists.debian.org
Usertags: hurd
Control: forwarded -1 
http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00040.html

Hi,

tar has been failing to build on hurd-i386 for a long time [1].

The issue basically boils in both a bug in Hurd in the O_NOFOLLOW
handling, and a bug in the tar code handling buggy/missing O_NOFOLLOW
cases. This leads to test extrac13.at failing.
I reported it upstream months ago [2] and the tar bug was fixed in
commit 6689e8d [3]. Attached there is a backport of that commit, which
makes the whole test suite run fine on the Hurd.

[1] 
https://buildd.debian.org/status/fetch.php?pkg=tar&arch=hurd-i386&ver=1.26%2Bdfsg-7&stamp=1376615451
[2] http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00040.html
[3] 
http://git.savannah.gnu.org/gitweb/?p=tar.git;a=commit;h=6689e8db4f53f6a0bed3d1bc4ed12d31eaa3bf51

Thanks,
-- 
Pino
>From 6689e8db4f53f6a0bed3d1bc4ed12d31eaa3bf51 Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Tue, 17 Jan 2012 22:21:52 -0800
Subject: [PATCH] tar: port --overwrite symlink test to GNU/Hurd

Problem reported by Pino Toscano in
<http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00040.html>.
* gnulib.modules: Add fcntl-h, which defines
HAVE_WORKING_O_NOFOLLOW.
* src/extract.c (open_output_file): Use HAVE_WORKING_O_NOFOLLOW,
not O_NOFOLLOW, when testing whther O_NOFOLLOW works.

This file is a placeholder. It will be replaced with the actual ChangeLog
by make dist.  Run make ChangeLog if you wish to create it earlier.
---
 gnulib.modules |    1 +
 src/extract.c  |    3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/extract.c b/src/extract.c
index 55f3eb8..bd5e7bf 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -887,7 +887,8 @@ open_output_file (char const *file_name, int typeflag, mode_t mode,
   /* If O_NOFOLLOW is needed but does not work, check for a symlink
      separately.  There's a race condition, but that cannot be avoided
      on hosts lacking O_NOFOLLOW.  */
-  if (! O_NOFOLLOW && overwriting_old_files && ! dereference_option)
+  if (! HAVE_WORKING_O_NOFOLLOW
+      && overwriting_old_files && ! dereference_option)
     {
       struct stat st;
       if (fstatat (chdir_fd, file_name, &st, AT_SYMLINK_NOFOLLOW) == 0
-- 
1.7.10.4

Reply via email to