summaryrefslogtreecommitdiff
path: root/archive-tar.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-14 20:04:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-15 17:51:55 (GMT)
commit29493589e97a2de0c4c1c314f61ccafaee3b5caf (patch)
treead4bc08358d295ecc87492b3ff9c231f909c3027 /archive-tar.c
parent82246e075e5c028dd886adda68e28de092e33df1 (diff)
downloadgit-29493589e97a2de0c4c1c314f61ccafaee3b5caf.zip
git-29493589e97a2de0c4c1c314f61ccafaee3b5caf.tar.gz
git-29493589e97a2de0c4c1c314f61ccafaee3b5caf.tar.bz2
archive-tar: huge offset and future timestamps would not work on 32-bit
As we are not yet moving everything to size_t but still using ulong internally when talking about the size of object, platforms with 32-bit long will not be able to produce tar archive with 4GB+ file, and cannot grok 077777777777UL as a constant. Disable the extended header feature and do not test it on them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive-tar.c')
-rw-r--r--archive-tar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/archive-tar.c b/archive-tar.c
index 7ea4e90..5568240 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -25,8 +25,13 @@ static int write_tar_filter_archive(const struct archiver *ar,
*
* Likewise for the mtime (which happens to use a buffer of the same size).
*/
+#if ULONG_MAX == 0xFFFFFFFF
+#define USTAR_MAX_SIZE ULONG_MAX
+#define USTAR_MAX_MTIME ULONG_MAX
+#else
#define USTAR_MAX_SIZE 077777777777UL
#define USTAR_MAX_MTIME 077777777777UL
+#endif
/* writes out the whole block, but only if it is full */
static void write_if_needed(void)