summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unpack/restore_fstree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/unpack/restore_fstree.c b/unpack/restore_fstree.c
index 4e763cb..21bae3f 100644
--- a/unpack/restore_fstree.c
+++ b/unpack/restore_fstree.c
@@ -157,9 +157,8 @@ static int set_attribs(fstree_t *fs, tree_node_t *n, int flags)
}
}
- if (flags & UNPACK_CHMOD) {
- if (fchmodat(AT_FDCWD, n->name, n->mode,
- AT_SYMLINK_NOFOLLOW)) {
+ if (flags & UNPACK_CHMOD && !S_ISLNK(n->mode)) {
+ if (fchmodat(AT_FDCWD, n->name, n->mode, 0)) {
fprintf(stderr, "chmod %s: %s\n",
n->name, strerror(errno));
return -1;