bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-tar] tar-1.25: test 39 fails on FreeBSD


From: Paul Eggert
Subject: Re: [Bug-tar] tar-1.25: test 39 fails on FreeBSD
Date: Wed, 24 Nov 2010 23:10:32 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

On 11/23/2010 07:26 PM, Bruno Haible wrote:

> Additionally, on NetBSD, the errno value EFTYPE should be turned into ELOOP
> in the same way. And possibly also ENOTSUP on OSF/1.
>   <http://gnats.netbsd.org/43154>
>   
> <http://www.sfr-fresh.com/unix/misc/xz-5.0.0.tar.gz:a/xz-5.0.0/src/xz/file_io.c>

Thanks for mentioning that.  I applied the following patch to GNU tar
for now, though it does seem like it'd make more sense to do this in gnulib.

>From 1e3795cf3057be35ae6db1bcf04d9af89261f306 Mon Sep 17 00:00:00 2001
From: Paul Eggert <address@hidden>
Date: Wed, 24 Nov 2010 23:07:46 -0800
Subject: [PATCH] tar: work around NetBSD and Tru64 symlink incompatibility with 
POSIX

Problem reported by Bruno Haible in
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00306.html>.
* src/extract.c (maybe_recoverable):  Also treat EFTYPE (if defined)
and ENOTSUP like ELOOP.
---
 src/extract.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/extract.c b/src/extract.c
index c52c9ce..aaea56e 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -609,9 +609,18 @@ maybe_recoverable (char *file_name, bool regular, bool 
*interdir_made)
   switch (e)
     {
     case ELOOP:
+
       /* With open ("symlink", O_NOFOLLOW|...), POSIX says errno == ELOOP,
-        but FreeBSD through at least 8.1 uses errno == EMLINK.  */
+        but some operating systems do not conform to the standard.  */
+#ifdef EFTYPE
+      /* NetBSD uses errno == EFTYPE; see <http://gnats.netbsd.org/43154>.  */
+    case EFTYPE:
+#endif
+      /* FreeBSD 8.1 uses errno == EMLINK.  */
     case EMLINK:
+      /* Tru64 5.1B uses errno == ENOTSUP.  */
+    case ENOTSUP:
+
       if (! regular
          || old_files_option != OVERWRITE_OLD_FILES || dereference_option)
        break;
-- 
1.7.2




reply via email to

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