Mask high mode bits in archive reader (#816)

This PR masks the high mode bits when setting file attributes for
consistency with mode at file creation.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
Kathryn Baldauf authored and GitHub committed 2026-07-27 11:42:07 -07:00
1 parent a4d2510a3c
commit 50f7722296
1 file changed
+1 -1
@@ -398,7 +398,7 @@ extension ArchiveReader {
}
private func setFileAttributes(fd: Int32, entry: WriteEntry) {
fchmod(fd, entry.permissions)
fchmod(fd, entry.permissions & 0o777)
if let owner = entry.owner, let group = entry.group {
fchown(fd, owner, group)
}