Browse Source

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.
Paul Eggert 14 years ago
parent
commit
649b747913
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/extract.c

+ 10 - 1
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;