Page MenuHomeFreeBSD
Paste P371

Masterwork From Distant Lands
ActivePublic

Authored by cem on Mar 10 2020, 7:13 PM.
diff --git a/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c b/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c
index ec29c5c418e4..aca51da76017 100644
--- a/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c
+++ b/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c
@@ -634,8 +634,8 @@ archive_format_gnutar_header(struct archive_write *a, char h[512],
memcpy(h + GNUTAR_gname_offset, p, copy_length);
}
- /* By truncating the mode here, we ensure it always fits. */
- format_octal(archive_entry_mode(entry) & 07777,
+ /* GNU tar mode allows base-256, all 16-bit mode_t values fit. */
+ format_number(archive_entry_mode(entry),
h + GNUTAR_mode_offset, GNUTAR_mode_size);
/* GNU tar supports base-256 here, so should never overflow. */

Event Timeline

cem edited the content of this paste. (Show Details)Mar 10 2020, 7:13 PM
cem changed the title of this paste from untitled to Masterwork From Distant Lands.