tar: don't change modes for hardlinks on extraction
Changing timestamps, modes and ownership of hardlinks makes no sense.
This commit is contained in:
parent
2f128ab050
commit
3c2f8b0cfa
3
tar.c
3
tar.c
|
@ -325,6 +325,9 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ])
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (h->type == HARDLINK)
|
||||||
|
return 0;
|
||||||
|
|
||||||
times[0].tv_sec = times[1].tv_sec = mtime;
|
times[0].tv_sec = times[1].tv_sec = mtime;
|
||||||
times[0].tv_nsec = times[1].tv_nsec = 0;
|
times[0].tv_nsec = times[1].tv_nsec = 0;
|
||||||
if (!mflag && utimensat(AT_FDCWD, fname, times, AT_SYMLINK_NOFOLLOW) < 0)
|
if (!mflag && utimensat(AT_FDCWD, fname, times, AT_SYMLINK_NOFOLLOW) < 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user