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.
This commit is contained in:
Paul Eggert
2010-11-24 23:07:46 -08:00
parent bb971a1e8a
commit 649b747913

View File

@@ -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;