summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2015-04-08 17:58:08 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-09 18:27:16 (GMT)
commitad194ae0b1d85e5e13f1c38a20d397dabccf80e9 (patch)
treea16440778603572215b2f7c2a8600c6d1dad8d24 /Utilities
parent732d8a467ab8a295b1bbf580f865980f8a1a9b29 (diff)
downloadCMake-ad194ae0b1d85e5e13f1c38a20d397dabccf80e9.zip
CMake-ad194ae0b1d85e5e13f1c38a20d397dabccf80e9.tar.gz
CMake-ad194ae0b1d85e5e13f1c38a20d397dabccf80e9.tar.bz2
libarchive: Use base-256 encoding for UID/GID like GNU tar does
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c
index 13942c1..647079d 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_gnutar.c
@@ -644,18 +644,18 @@ archive_format_gnutar_header(struct archive_write *a, char h[512],
format_octal(archive_entry_mode(entry) & 07777,
h + GNUTAR_mode_offset, GNUTAR_mode_size);
- /* TODO: How does GNU tar handle large UIDs? */
- if (format_octal(archive_entry_uid(entry),
- h + GNUTAR_uid_offset, GNUTAR_uid_size)) {
+ /* GNU tar supports base-256 here, so should never overflow. */
+ if (format_number(archive_entry_uid(entry), h + GNUTAR_uid_offset,
+ GNUTAR_uid_size, GNUTAR_uid_max_size)) {
archive_set_error(&a->archive, ERANGE,
"Numeric user ID %jd too large",
(intmax_t)archive_entry_uid(entry));
ret = ARCHIVE_FAILED;
}
- /* TODO: How does GNU tar handle large GIDs? */
- if (format_octal(archive_entry_gid(entry),
- h + GNUTAR_gid_offset, GNUTAR_gid_size)) {
+ /* GNU tar supports base-256 here, so should never overflow. */
+ if (format_number(archive_entry_gid(entry), h + GNUTAR_gid_offset,
+ GNUTAR_gid_size, GNUTAR_gid_max_size)) {
archive_set_error(&a->archive, ERANGE,
"Numeric group ID %jd too large",
(intmax_t)archive_entry_gid(entry));