aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-12-21 08:59:24 +0000
committerEric Andersen <andersen@codepoet.org>2003-12-21 08:59:24 +0000
commit67ff3a1ffd5e9dcf049bd6c3f9dbf73a1862abe5 (patch)
treeaae69dd96d4e8db2ee966e62c661c1a3efae8654 /archival/libunarchive
parent0933a92f5a623435c492fa98ed5f3309f88b6c1e (diff)
downloadbusybox-67ff3a1ffd5e9dcf049bd6c3f9dbf73a1862abe5.tar.gz
Don't hose up perms for files that happen to have symlinks
in the tarball that point to them. -Erik
Diffstat (limited to 'archival/libunarchive')
-rw-r--r--archival/libunarchive/data_extract_all.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c
index b77cd11ae..4cff24339 100644
--- a/archival/libunarchive/data_extract_all.c
+++ b/archival/libunarchive/data_extract_all.c
@@ -111,8 +111,10 @@ extern void data_extract_all(archive_handle_t *archive_handle)
}
}
- chown(file_header->name, file_header->uid, file_header->gid);
- chmod(file_header->name, file_header->mode);
+ lchown(file_header->name, file_header->uid, file_header->gid);
+ if ((file_header->mode & S_IFMT) != S_IFLNK) {
+ chmod(file_header->name, file_header->mode);
+ }
if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) {
struct utimbuf t;