From 3c2f8b0cfa592bbe31ee4270cf275acfd261cd71 Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Mon, 15 Feb 2016 08:03:17 +0000 Subject: [PATCH] tar: don't change modes for hardlinks on extraction Changing timestamps, modes and ownership of hardlinks makes no sense. --- tar.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tar.c b/tar.c index 10b2e30..b4ba2d6 100644 --- a/tar.c +++ b/tar.c @@ -325,6 +325,9 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ]) close(fd); } + if (h->type == HARDLINK) + return 0; + times[0].tv_sec = times[1].tv_sec = mtime; times[0].tv_nsec = times[1].tv_nsec = 0; if (!mflag && utimensat(AT_FDCWD, fname, times, AT_SYMLINK_NOFOLLOW) < 0)