From 649b747913d2b289e904b5f1d222af886acd209c Mon Sep 17 00:00:00 2001 From: Paul Eggert 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 . * src/extract.c (maybe_recoverable): Also treat EFTYPE (if defined) and ENOTSUP like ELOOP. --- src/extract.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 . */ + 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; -- 2.44.0