[hackers] [sbase] tar: don't change modes for hardlinks on extraction || Eivind Uggedal

From: <git_AT_suckless.org>
Date: Mon, 15 Feb 2016 10:42:02 +0100 (CET)

commit 3c2f8b0cfa592bbe31ee4270cf275acfd261cd71
Author: Eivind Uggedal <eivind_AT_uggedal.com>
AuthorDate: Mon Feb 15 08:03:17 2016 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Mon Feb 15 09:41:58 2016 +0000

    tar: don't change modes for hardlinks on extraction
    
    Changing timestamps, modes and ownership of hardlinks
    makes no sense.

diff --git a/tar.c b/tar.c
index 10b2e30..b4ba2d6 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -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)
Received on Mon Feb 15 2016 - 10:42:02 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 15 2016 - 10:48:23 CET