aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archival/libarchive/get_header_ar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/archival/libarchive/get_header_ar.c b/archival/libarchive/get_header_ar.c
index 3a19d6ff7..6bd897392 100644
--- a/archival/libarchive/get_header_ar.c
+++ b/archival/libarchive/get_header_ar.c
@@ -92,8 +92,12 @@ char FAST_FUNC get_header_ar(archive_handle_t *archive_handle)
92 /* Only size is always present, the rest may be missing in 92 /* Only size is always present, the rest may be missing in
93 * long filename pseudo file. Thus we decode the rest 93 * long filename pseudo file. Thus we decode the rest
94 * after dealing with long filename pseudo file. 94 * after dealing with long filename pseudo file.
95 *
96 * GNU binutils in deterministic mode hard codes mode to 0644 (NOT
97 * 0100644). AR archives can only contain files, so force file
98 * mode.
95 */ 99 */
96 typed->mode = read_num(ar.formatted.mode, 8, sizeof(ar.formatted.mode)); 100 typed->mode = read_num(ar.formatted.mode, 8, sizeof(ar.formatted.mode)) | S_IFREG;
97 typed->gid = read_num(ar.formatted.gid, 10, sizeof(ar.formatted.gid)); 101 typed->gid = read_num(ar.formatted.gid, 10, sizeof(ar.formatted.gid));
98 typed->uid = read_num(ar.formatted.uid, 10, sizeof(ar.formatted.uid)); 102 typed->uid = read_num(ar.formatted.uid, 10, sizeof(ar.formatted.uid));
99 typed->mtime = read_num(ar.formatted.date, 10, sizeof(ar.formatted.date)); 103 typed->mtime = read_num(ar.formatted.date, 10, sizeof(ar.formatted.date));