From: Eric Andersen Date: Sun, 21 Dec 2003 08:59:24 +0000 (-0000) Subject: Don't hose up perms for files that happen to have symlinks X-Git-Tag: 1_00_pre5~5 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=67ff3a1ffd5e9dcf049bd6c3f9dbf73a1862abe5;p=oweals%2Fbusybox.git Don't hose up perms for files that happen to have symlinks in the tarball that point to them. -Erik --- 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;