{"thread":{"id":"66464","subject":"[BUG] ZIP timestamp conversion and strict fast-import date validation","startedAt":"2026-10-05T13:48:20Z","lastAt":"2026-11-20T16:12:27Z","messageCount":15,"participants":["Matthew E. Luallen","René Scharfe","m@sph3r3.com","Junio C Hamano","Aniket Gupta"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"554178","messageId":"CA+h9NxRT-9QzLGihdL_Bp-yyt1AdXJ79YYgpK-OaegUz8e+HcA@mail.gmail.com","threadId":"66464","inReplyTo":null,"subject":"[BUG] ZIP timestamp conversion and strict fast-import date validation","fromName":"Matthew E. Luallen","fromEmail":"m@sph3r3.com","sentAt":"2026-10-05T13:48:20Z","receivedAt":"2026-10-05T13:48:20Z","isPatch":false,"sender":{"key":"m@sph3r3.com","avatar":null},"body":"Hello Git community,\n\nI'm reporting three date-handling bugs reproduced on Apple Git 2.50.1\nand upstream Git 2.56.0:\n\n1. Exporting a 1972-dated commit with git archive --format=zip produces\n   a legacy DOS date interpreted as 2100, while the extended Unix\n   timestamp retains 1972.\n2. Exporting a commit at epoch 4294967296 (2106-02-07 06:28:16 UTC)\n   wraps ZIP's four-byte extended timestamp to zero (1970). Exporting\n   the same commit as TAR preserves the original value.\n3. git fast-import --date-format=raw accepts -32184000 +0000, but\n   git fsck --strict then reports badDate and ISO rendering returns\n   literal placeholders. This occurs in strict raw mode, not just\n   the deliberately permissive import mode.\n\nFor the archive cases, export the dated commit with:\n\n    git archive --format=zip <commit> > test.zip\n    git archive --format=tar <commit> > test.tar\n\nCompare the ZIP DOS and extended timestamp fields with the TAR mtime.\nThe overflow affects consumer behavior: in macOS tests, UnZip update\nmode retained different existing 2025 content because the 2106 ZIP\nappeared older. An in-range 2038 ZIP replaced that content.\n\nWhat range-handling policy should ZIP use, and should strict raw import\nreject timestamps that fsck considers invalid?\n\nThank you,\nMatthew E. Luallen (@meluallen)\nWith research, reproduction, and drafting assistance from OpenAI Codex.\n\n"},{"id":"554217","messageId":"f8dc40a4-920d-4dc5-9f71-7686bfc6255b@web.de","threadId":"66464","inReplyTo":"CA+h9NxRT-9QzLGihdL_Bp-yyt1AdXJ79YYgpK-OaegUz8e+HcA@mail.gmail.com","subject":"Re: [BUG] ZIP timestamp conversion and strict fast-import date validation","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-10-05T19:49:33Z","receivedAt":"2026-10-05T19:49:33Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"On 10/5/26 3:48 PM, Matthew E. Luallen wrote:\n> Hello Git community,\n> \n> I'm reporting three date-handling bugs reproduced on Apple Git 2.50.1\n> and upstream Git 2.56.0:\n> \n> 1. Exporting a 1972-dated commit with git archive --format=zip produces\n>    a legacy DOS date interpreted as 2100, while the extended Unix\n>    timestamp retains 1972.\n\nDOS timestamps can express years starting from 1980.  Unix timestamps\nstart at 1970.  We can't provide a DOS timestamp for 1972, but can we do\nbetter?  zip(1) clamps DOS timestamps to zero = the DOS epoch =\n1980-01-01 00:00:00.\n\nIs anything using the DOS timestamp even though a Unix timestamp is\npresent?\n\n> 2. Exporting a commit at epoch 4294967296 (2106-02-07 06:28:16 UTC)\n>    wraps ZIP's four-byte extended timestamp to zero (1970). Exporting\n>    the same commit as TAR preserves the original value.\n\ntar's timestamp can range from 1970 to 2242 with standard headers and\nbeyond indefinitely with extended headers.\n\nWe cannot put a higher value than 4294967295 into the four-byte field\nprovided by the Unix time extension for ZIP, but we could clamp to that\nvalue.  zip(1) wraps around as well, though..\n\n(I'm using \"Zip 3.0 (July 5th 2008), by Info-ZIP, with modifications by\nApple Inc.\")\n\n> 3. git fast-import --date-format=raw accepts -32184000 +0000, but\n>    git fsck --strict then reports badDate and ISO rendering returns\n>    literal placeholders. This occurs in strict raw mode, not just\n>    the deliberately permissive import mode.\n\nWell, raw mode passes on the timestamp value with only little checks.\nstrtoul(3) used in builtin/fast-import.c::validate_raw_date() happily\naccepts negative numbers.  The latter function contains two NEEDSWORK\ncomments about perhaps adding more checks, though.\n\nRené\n\n\n"},{"id":"554221","messageId":"CA+h9NxQEJaKrbTXUeryEhNMfOfuU0EykiJRi3PaJE9dRFo5tWw@mail.gmail.com","threadId":"66464","inReplyTo":"f8dc40a4-920d-4dc5-9f71-7686bfc6255b@web.de","subject":"Re: [BUG] ZIP timestamp conversion and strict fast-import date validation","fromName":"Matthew E. Luallen","fromEmail":"m@sph3r3.com","sentAt":"2026-10-05T20:32:32Z","receivedAt":"2026-10-05T20:32:32Z","isPatch":false,"sender":{"key":"m@sph3r3.com","avatar":null},"body":"Hi René,\n\nThank you for the thoughtful response. I appreciate your help.\n\n- Reader example: Python 3.14.7's ZipInfo.date_time reports 2100 for\n  the 1972 ZIP despite its correct Unix timestamp. Our tested UnZip\n  and bsdtar restored 1972 correctly; this is a metadata-reading example.\n\n- Separate consequence: the 2106-to-1970 wrap caused UnZip update mode\n  to retain different existing 2025 content. The 2038 control updated\n  correctly. No deployed security bypass has been demonstrated.\n\n- Fix direction: would you prefer clamping or rejecting ZIP timestamps\n  beyond the Unix field's range? Our candidate rejects them. Would\n  rejecting negative dates in strict raw import be a useful first step?\n\nAttached is brief guidance on misinterpretation risks, clearer date\nlabels, and safer downstream decisions. These suggestions complement\nthe ordinary bug fixes without asserting a security classification.\n\nBest,\nMatt\n\n\nGIT TIMESTAMP GUIDANCE: INTERPRETATION, INTEGRITY AND REMEDIATION\n5 October 2026 | Companion to the public Git date-handling discussion\n\nWHY IT MATTERS\n\n- Interpretation: dates can be mistaken for creation, publication or\n  approval times. Conversion errors can mislead without malicious intent.\n- Scale: repeated reliance on dates across update, review and audit\n  pipelines could multiply errors. Prevalence has not been measured.\n- Security impact requires attacker-influenced metadata to affect a\n  security decision without independent checks. A local update decision\n  changed; a production security bypass has not been demonstrated.\n\nOBSERVED, WITH CONTROLS\n\n- Python 3.14.7 reads the 1972 ZIP's DOS date as 2100 despite the correct\n  Unix extra field. UnZip 6.00 and bsdtar 3.5.3 restored 1972; Python's\n  ordinary extraction used a current local modification time.\n- A 2106 commit's ZIP Unix timestamp wrapped to 1970; UnZip update mode\n  kept different existing 2025 bytes. A 2038 control replaced them;\n  TAR preserved 2106. Strict raw import also accepted a negative date\n  subsequently rejected by strict fsck. Reader behavior varies by platform.\n\nPRACTICAL OPTIONS\n\n- Exporters: validate ranges before encoding. Clamp pre-1980 DOS dates\n  while preserving representable Unix dates. For Unix-field overflow,\n  choose rejection or documented clamping; clamping loses the original\n  value. Our candidate rejects overflow. These are proposed policies.\n- Importers: align strict parsing with validation; check negative values,\n  complete numeric input and overflow. Keep permissive modes explicit.\n  Test boundaries across timezones and archive readers.\n- Consumers: decide updates using expected content/version information\n  from a trusted source, not modification time alone. For change review,\n  retain a trusted baseline commit and compare reachable changes; handle\n  missing or rewritten history explicitly. Date windows do not establish\n  complete coverage of newly received content.\n- Displays: distinguish 'committer-supplied date', 'archive modification\n  time' and 'server observed at'. Explain clamping and missing evidence.\n  Server receipt is not original creation or first publication elsewhere.\n- Evidence: preserve original bytes and independent receipt records.\n  Commit signatures bind signed content to a key under a trust policy;\n  they do not independently prove its claimed creation time. A validated\n  trusted timestamp can support existence by a time, not exact creation.\n\nRISK TAXONOMY, NOT A VULNERABILITY ASSIGNMENT\n\n- Numeric representation/truncation: CWE-197; wraparound: CWE-190.\n- Validation: CWE-20 (broad category). Downstream trust: CWE-807 only\n  where a security decision relies on untrusted input. Display confusion\n  alone does not establish it. These labels do not establish severity.\n\nREFERENCES AND EVIDENCE\n\nGit date controls: https://git-scm.com/docs/git-commit#_commit_information\nArchive behavior: https://git-scm.com/docs/git-archive#_description\nCWE taxonomy: https://cwe.mitre.org/data/definitions/197.html\nhttps://cwe.mitre.org/data/definitions/190.html\nhttps://cwe.mitre.org/data/definitions/20.html\nhttps://cwe.mitre.org/data/definitions/807.html\nTrusted timestamp semantics: https://www.rfc-editor.org/rfc/rfc3161\nEvidence: recorded 2026-10-01 consumer-date-impact results and Git matrix;\nno new experiment is claimed by this guidance.\n\nMatthew E. Luallen (@meluallen), with research, reproduction and drafting\nassistance from OpenAI Codex.\n"},{"id":"554230","messageId":"CA+h9NxSzuNNQZ0pKKso9Y8BkXKZYgrGFLL050Pi3O7PC_gi65g@mail.gmail.com","threadId":"66464","inReplyTo":"f8dc40a4-920d-4dc5-9f71-7686bfc6255b@web.de","subject":"Re: [BUG] ZIP timestamp conversion and strict fast-import date validation","fromName":"","fromEmail":"m@sph3r3.com","sentAt":"2026-10-06T03:22:36Z","receivedAt":"2026-10-06T03:22:36Z","isPatch":false,"sender":{"key":"m@sph3r3.com","avatar":null},"body":"Hi René,\n\nThanks for the explanation. Python 3.14.7’s ZipInfo.date_time is one\nexample: it reads the DOS date as 2100 for the 1972 archive, even\nthough the correct Unix timestamp is present. This affects metadata\nreading; the tested UnZip and bsdtar restored 1972 correctly.\n\nThe 2106 case is separate: the Unix timestamp wraps to 1970, causing\nUnZip update mode to retain different existing 2025 content. The 2038\ncontrol replaced that content as expected.\n\nBest,\nMatthew\n\nOn Mon, 05 Oct 2026 21:49:33 +0200, René Scharfe <l.s.r@web.de> wrote:\n> On 10/5/26 3:48 PM, Matthew E. Luallen wrote:\n> > Hello Git community,\n> >\n> > I'm reporting three date-handling bugs reproduced on Apple Git 2.50.1\n> > and upstream Git 2.56.0:\n> >\n> > 1. Exporting a 1972-dated commit with git archive --format=zip produces\n> >    a legacy DOS date interpreted as 2100, while the extended Unix\n> >    timestamp retains 1972.\n>\n> DOS timestamps can express years starting from 1980.  Unix timestamps\n> start at 1970.  We can't provide a DOS timestamp for 1972, but can we do\n> better?  zip(1) clamps DOS timestamps to zero = the DOS epoch =\n> 1980-01-01 00:00:00.\n>\n> Is anything using the DOS timestamp even though a Unix timestamp is\n> present?\n>\n> > 2. Exporting a commit at epoch 4294967296 (2106-02-07 06:28:16 UTC)\n> >    wraps ZIP's four-byte extended timestamp to zero (1970). Exporting\n> >    the same commit as TAR preserves the original value.\n>\n> tar's timestamp can range from 1970 to 2242 with standard headers and\n> beyond indefinitely with extended headers.\n>\n> We cannot put a higher value than 4294967295 into the four-byte field\n> provided by the Unix time extension for ZIP, but we could clamp to that\n> value.  zip(1) wraps around as well, though..\n>\n> (I'm using \"Zip 3.0 (July 5th 2008), by Info-ZIP, with modifications by\n> Apple Inc.\")\n>\n> > 3. git fast-import --date-format=raw accepts -32184000 +0000, but\n> >    git fsck --strict then reports badDate and ISO rendering returns\n> >    literal placeholders. This occurs in strict raw mode, not just\n> >    the deliberately permissive import mode.\n>\n> Well, raw mode passes on the timestamp value with only little checks.\n> strtoul(3) used in builtin/fast-import.c::validate_raw_date() happily\n> accepts negative numbers.  The latter function contains two NEEDSWORK\n> comments about perhaps adding more checks, though.\n>\n> René\n\n"},{"id":"554387","messageId":"6abe7f35-a1e4-4870-88d5-45ee40f5a061@web.de","threadId":"66464","inReplyTo":"CA+h9NxQEJaKrbTXUeryEhNMfOfuU0EykiJRi3PaJE9dRFo5tWw@mail.gmail.com","subject":"Re: [BUG] ZIP timestamp conversion and strict fast-import date validation","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-10-07T15:33:09Z","receivedAt":"2026-10-07T15:33:09Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"On 10/5/26 10:32 PM, Matthew E. Luallen wrote:\n> \n> - Reader example: Python 3.14.7's ZipInfo.date_time reports 2100 for\n>   the 1972 ZIP despite its correct Unix timestamp.\n\nMakes sense.  Its source code,\nhttps://github.com/python/cpython/blob/3.14/Lib/zipfile/__init__.py,\ncontains a decode function for two extra fields, Zip64 (0x0001) and\nInfo-ZIP Unicode Path (0x7075), but no support for UNIX (0x000d).\nAnd why should it?\n\n> - Separate consequence: the 2106-to-1970 wrap caused UnZip update mode\n>   to retain different existing 2025 content. The 2038 control updated\n>   correctly. No deployed security bypass has been demonstrated.\n\nI'm not aware of a ZIP extension that allows storing arbitrary dates.\nI see three options:\n\n- Don't color outside the lines, only emit ZIP files with valid DOS\n  and UNIX timestamps and refuse to write earlier or later ones,\n\n- wrap consistently, which can be confusing, but allows users to\n  recover the original timestamp when they supply the higher bits\n  (like we can say twenties now to mean 202x and 30 years ago we\n  meant 192x), or\n\n- map all earlier timestamps to the epoch and later ones to the maximum\n  value, effectively stopping time at the borders -- all mtimes will be\n  0xffffffff forever after that point is crossed, making them useless,\n  except as a marker that a yet to be invented extension needs to be\n  consulted to get the real mtime value.\n\n> - Fix direction: would you prefer clamping or rejecting ZIP timestamps\n>   beyond the Unix field's range? Our candidate rejects them. Would\n>   rejecting negative dates in strict raw import be a useful first step?\n\nRejecting non-representable timestamps when creating ZIP files seems\nlike the most honest option.  Perhaps it's annoying enough to motivate\npeople to find a proper solution?  Which could be \"use the tar format\".\n\nIt would be nice if there was an example to follow.  Info-ZIP zip(1)\nclamping at the low end and rolling over at the high end seems odd,\nthough.\n\nRejecting negative timestamps on fast-import or at all seems bad for\npeople who want to import ancient records.  Git commit objects store\ntimestamps as decimal numeric strings, so they can support arbitrarily\nhigh and low values.  Importing mainframe file versions from the\nsixties or versions of legal documents from the last few hundred years\ndon't seem too outlandish.\n\ntimestamp_t, Git's in-memory representation, is unsigned for\nhistorical reasons, but that is not necessarily fixed in stone.\n\nRené\n\n\n"},{"id":"554717","messageId":"595dafac-33c7-4c45-9cac-c868cf1f8bb0@web.de","threadId":"66464","inReplyTo":"CA+h9NxRT-9QzLGihdL_Bp-yyt1AdXJ79YYgpK-OaegUz8e+HcA@mail.gmail.com","subject":"[PATCH] archive-zip: omit UT extra field if mtime is out of range","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-10-11T16:06:04Z","receivedAt":"2026-10-11T16:06:04Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"We write an Extended Timestamp Extra Field (ID 0x5455 = \"UT\") for each\nzip entry, like Info-ZIP zip(1) does.  Its time values are signed 32-bit\nintegers (see e.g. https://libzip.org/specifications/extrafld.txt).\nStop emitting them when the commit time doesn't fit in.\n\nUse a strbuf to prepare the extra field up front.  Keep it empty if the\ntime value is out of range.  Like for the central zip directory we only\ncare about the length-limited buffer aspect of the strbuf, not about\nNUL-termination.  This simplifies the conditional output by avoiding to\nrepeat the condition.\n\nReported-by: Matthew E. Luallen <m@sph3r3.com>\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n archive-zip.c                   | 37 +++++++++++++--------------------\n t/t5004-archive-corner-cases.sh | 28 +++++++++++++++++++++++++\n 2 files changed, 43 insertions(+), 22 deletions(-)\n\ndiff --git a/archive-zip.c b/archive-zip.c\nindex 6f73ca6d58..785689584c 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -24,6 +24,7 @@ static int zip_time;\n \n /* We only care about the \"buf\" part here. */\n static struct strbuf zip_dir;\n+static struct strbuf zip_extra_mtime;\n \n static uintmax_t zip_offset;\n static uint64_t zip_dir_entries;\n@@ -81,14 +82,6 @@ struct zip_dir_trailer {\n \tunsigned char _end[1];\n };\n \n-struct zip_extra_mtime {\n-\tunsigned char magic[2];\n-\tunsigned char extra_size[2];\n-\tunsigned char flags[1];\n-\tunsigned char mtime[4];\n-\tunsigned char _end[1];\n-};\n-\n struct zip64_extra {\n \tunsigned char magic[2];\n \tunsigned char extra_size[2];\n@@ -129,9 +122,6 @@ struct zip64_dir_trailer_locator {\n #define ZIP64_DATA_DESC_SIZE\toffsetof(struct zip64_data_desc, _end)\n #define ZIP_DIR_HEADER_SIZE\toffsetof(struct zip_dir_header, _end)\n #define ZIP_DIR_TRAILER_SIZE\toffsetof(struct zip_dir_trailer, _end)\n-#define ZIP_EXTRA_MTIME_SIZE\toffsetof(struct zip_extra_mtime, _end)\n-#define ZIP_EXTRA_MTIME_PAYLOAD_SIZE \\\n-\t(ZIP_EXTRA_MTIME_SIZE - offsetof(struct zip_extra_mtime, flags))\n #define ZIP64_EXTRA_SIZE\toffsetof(struct zip64_extra, _end)\n #define ZIP64_EXTRA_PAYLOAD_SIZE \\\n \t(ZIP64_EXTRA_SIZE - offsetof(struct zip64_extra, size))\n@@ -299,9 +289,8 @@ static int write_zip_entry(struct archiver_args *args,\n {\n \tstruct zip_local_header header;\n \tuintmax_t offset = zip_offset;\n-\tstruct zip_extra_mtime extra;\n \tstruct zip64_extra extra64;\n-\tsize_t header_extra_size = ZIP_EXTRA_MTIME_SIZE;\n+\tsize_t header_extra_size = zip_extra_mtime.len;\n \tint need_zip64_extra = 0;\n \tunsigned long attr2;\n \tunsigned long compressed_size;\n@@ -315,7 +304,7 @@ static int write_zip_entry(struct archiver_args *args,\n \tconst char *path_without_prefix = path + args->baselen;\n \tunsigned int creator_version = 0;\n \tunsigned int version_needed = 10;\n-\tsize_t zip_dir_extra_size = ZIP_EXTRA_MTIME_SIZE;\n+\tsize_t zip_dir_extra_size = zip_extra_mtime.len;\n \tsize_t zip64_dir_extra_payload_size = 0;\n \n \tcrc = crc32(0, NULL, 0);\n@@ -381,11 +370,6 @@ static int write_zip_entry(struct archiver_args *args,\n \t\t}\n \t}\n \n-\tcopy_le16(extra.magic, 0x5455);\n-\tcopy_le16(extra.extra_size, ZIP_EXTRA_MTIME_PAYLOAD_SIZE);\n-\textra.flags[0] = 1;\t/* just mtime */\n-\tcopy_le32(extra.mtime, args->time);\n-\n \tif (size > 0xffffffff || compressed_size > 0xffffffff)\n \t\tneed_zip64_extra = 1;\n \tif (stream && size > 0x7fffffff)\n@@ -412,8 +396,8 @@ static int write_zip_entry(struct archiver_args *args,\n \tzip_offset += ZIP_LOCAL_HEADER_SIZE;\n \twrite_or_die(1, path, pathlen);\n \tzip_offset += pathlen;\n-\twrite_or_die(1, &extra, ZIP_EXTRA_MTIME_SIZE);\n-\tzip_offset += ZIP_EXTRA_MTIME_SIZE;\n+\twrite_or_die(1, zip_extra_mtime.buf, zip_extra_mtime.len);\n+\tzip_offset += zip_extra_mtime.len;\n \tif (need_zip64_extra) {\n \t\tcopy_le16(extra64.magic, 0x0001);\n \t\tcopy_le16(extra64.extra_size, ZIP64_EXTRA_PAYLOAD_SIZE);\n@@ -546,7 +530,7 @@ static int write_zip_entry(struct archiver_args *args,\n \tstrbuf_add_le(&zip_dir, 4, attr2);\n \tstrbuf_add_le(&zip_dir, 4, clamp32(offset));\n \tstrbuf_add(&zip_dir, path, pathlen);\n-\tstrbuf_add(&zip_dir, &extra, ZIP_EXTRA_MTIME_SIZE);\n+\tstrbuf_addbuf(&zip_dir, &zip_extra_mtime);\n \tif (zip64_dir_extra_payload_size) {\n \t\tstrbuf_add_le(&zip_dir, 2, 0x0001);\t/* magic */\n \t\tstrbuf_add_le(&zip_dir, 2, zip64_dir_extra_payload_size);\n@@ -644,12 +628,21 @@ static int write_zip_archive(const struct archiver *ar UNUSED,\n \tdos_time(&args->time, &zip_date, &zip_time);\n \n \tstrbuf_init(&zip_dir, 0);\n+\tstrbuf_init(&zip_extra_mtime, 0);\n+\n+\tif (args->time <= 0x7fffffff) {\n+\t\tstrbuf_add_le(&zip_extra_mtime, 2, 0x5455); /* magic */\n+\t\tstrbuf_add_le(&zip_extra_mtime, 2, 1 + 4); /* payload size */\n+\t\tstrbuf_add_le(&zip_extra_mtime, 1, 1); /* flags; just mtime */\n+\t\tstrbuf_add_le(&zip_extra_mtime, 4, args->time);\n+\t}\n \n \terr = write_archive_entries(args, write_zip_entry);\n \tif (!err)\n \t\twrite_zip_trailer(args->commit_oid);\n \n \tstrbuf_release(&zip_dir);\n+\tstrbuf_release(&zip_extra_mtime);\n \n \treturn err;\n }\ndiff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\nindex 768b0ff85d..20bab21048 100755\n--- a/t/t5004-archive-corner-cases.sh\n+++ b/t/t5004-archive-corner-cases.sh\n@@ -227,4 +227,32 @@ test_expect_success 'tar archive with long paths' '\n \tgit archive -o long_paths.tar $tree\n '\n \n+test_lazy_prereq ZIPINFO_UT_EXTRA '\n+\t\"$ZIPINFO\" -v \"$TEST_DIRECTORY\"/t5004/big-pack.zip |\n+\tgrep \"UT extra field modtime\"\n+'\n+\n+test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n+\tblob=$(echo foo | git hash-object -w --stdin) &&\n+\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n+\tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n+'\n+\n+test_expect_success TIME_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n+\tblob=$(echo foo | git hash-object -w --stdin) &&\n+\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n+\tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n+'\n+\n+test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA 'UT extra field' '\n+\t\"$ZIPINFO\" -v with_ut_extra.zip >actual &&\n+\ttest_grep \"UT extra field modtime\" actual\n+'\n+\n+test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA \\\n+\t'UT extra field omitted when mtime exceeds 32-bit' '\n+\t\"$ZIPINFO\" -v without_ut_extra.zip >actual &&\n+\ttest_grep ! \"UT extra field modtime\" actual\n+'\n+\n test_done\n-- \n2.56.0\n\n"},{"id":"554738","messageId":"87jynn8ycv.fsf@gitster.g","threadId":"66464","inReplyTo":"595dafac-33c7-4c45-9cac-c868cf1f8bb0@web.de","subject":"Re: [PATCH] archive-zip: omit UT extra field if mtime is out of range","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-12T02:08:16Z","receivedAt":"2026-10-12T02:08:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\n> index 768b0ff85d..20bab21048 100755\n> --- a/t/t5004-archive-corner-cases.sh\n> +++ b/t/t5004-archive-corner-cases.sh\n> @@ -227,4 +227,32 @@ test_expect_success 'tar archive with long paths' '\n>  \tgit archive -o long_paths.tar $tree\n>  '\n>  \n> +test_lazy_prereq ZIPINFO_UT_EXTRA '\n> +\t\"$ZIPINFO\" -v \"$TEST_DIRECTORY\"/t5004/big-pack.zip |\n> +\tgrep \"UT extra field modtime\"\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n> +\tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n> +\tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n> +'\n\nBoth Ubuntu/20.02 i386 (which is going away so you do not have to\ndeeply care) and Debian/latest i386 (which we plan to use to replace\nthe Ubuntu/20.02 i386, so it would be superb to get it work) jobs\nseem to fail this one.\n\nhttps://github.com/git/git/actions/runs/38189684665/job/114619579067#step:10:321\nhttps://github.com/git/git/actions/runs/38189685137/job/114619583658#step:10:337\n\nThanks.\n\n> +\n> +test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA 'UT extra field' '\n> +\t\"$ZIPINFO\" -v with_ut_extra.zip >actual &&\n> +\ttest_grep \"UT extra field modtime\" actual\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA \\\n> +\t'UT extra field omitted when mtime exceeds 32-bit' '\n> +\t\"$ZIPINFO\" -v without_ut_extra.zip >actual &&\n> +\ttest_grep ! \"UT extra field modtime\" actual\n> +'\n> +\n>  test_done\n\n"},{"id":"554756","messageId":"CA+h9NxRQLP=20kfmSm6B2WtkkmHDCfdRDZEawOpzFF1LoghTEA@mail.gmail.com","threadId":"66464","inReplyTo":"595dafac-33c7-4c45-9cac-c868cf1f8bb0@web.de","subject":"Re: [PATCH] archive-zip: omit UT extra field if mtime is out of range","fromName":"","fromEmail":"m@sph3r3.com","sentAt":"2026-10-12T12:56:19Z","receivedAt":"2026-10-12T12:56:19Z","isPatch":true,"sender":{"key":"m@sph3r3.com","avatar":null},"body":"Hi René,\n\nThanks for the patch. I confirmed that it fixes the 2106 case: before\nthe change, UT wrapped to zero and unzip -u retained the existing 2025\nfile; afterward, UT is omitted and the file is replaced correctly.\n\nFor the i386 failure Junio reported, the beyond-2038 archive test and\nits dependent omission check should use TIME_T_IS_64BIT. TIME_IS_64BIT\nchecks Git's timestamp_t, which can be 64-bit while time_t is 32-bit.\n\nWith that two-line adjustment, all 18 t5004 tests pass on x86-64\nLinux. Forcing TIME_T_IS_64BIT off skips only those two tests; the\nother 16 pass, including both INT32_MAX checks. I haven't run a native\n32-bit build.\n\nBest,\nMatthew\n\nOn Sun, 11 Oct 2026 18:06:04 +0200, René Scharfe <l.s.r@web.de> wrote:\n> We write an Extended Timestamp Extra Field (ID 0x5455 = \"UT\") for each\n> zip entry, like Info-ZIP zip(1) does.  Its time values are signed 32-bit\n> integers (see e.g. https://libzip.org/specifications/extrafld.txt).\n> Stop emitting them when the commit time doesn't fit in.\n>\n> Use a strbuf to prepare the extra field up front.  Keep it empty if the\n> time value is out of range.  Like for the central zip directory we only\n> care about the length-limited buffer aspect of the strbuf, not about\n> NUL-termination.  This simplifies the conditional output by avoiding to\n> repeat the condition.\n>\n> Reported-by: Matthew E. Luallen <m@sph3r3.com>\n> Signed-off-by: René Scharfe <l.s.r@web.de>\n> ---\n>  archive-zip.c                   | 37 +++++++++++++--------------------\n>  t/t5004-archive-corner-cases.sh | 28 +++++++++++++++++++++++++\n>  2 files changed, 43 insertions(+), 22 deletions(-)\n>\n> diff --git a/archive-zip.c b/archive-zip.c\n> index 6f73ca6d58..785689584c 100644\n> --- a/archive-zip.c\n> +++ b/archive-zip.c\n> @@ -24,6 +24,7 @@ static int zip_time;\n>\n>  /* We only care about the \"buf\" part here. */\n>  static struct strbuf zip_dir;\n> +static struct strbuf zip_extra_mtime;\n>\n>  static uintmax_t zip_offset;\n>  static uint64_t zip_dir_entries;\n> @@ -81,14 +82,6 @@ struct zip_dir_trailer {\n>  \tunsigned char _end[1];\n>  };\n>\n> -struct zip_extra_mtime {\n> -\tunsigned char magic[2];\n> -\tunsigned char extra_size[2];\n> -\tunsigned char flags[1];\n> -\tunsigned char mtime[4];\n> -\tunsigned char _end[1];\n> -};\n> -\n>  struct zip64_extra {\n>  \tunsigned char magic[2];\n>  \tunsigned char extra_size[2];\n> @@ -129,9 +122,6 @@ struct zip64_dir_trailer_locator {\n>  #define ZIP64_DATA_DESC_SIZE\toffsetof(struct zip64_data_desc, _end)\n>  #define ZIP_DIR_HEADER_SIZE\toffsetof(struct zip_dir_header, _end)\n>  #define ZIP_DIR_TRAILER_SIZE\toffsetof(struct zip_dir_trailer, _end)\n> -#define ZIP_EXTRA_MTIME_SIZE\toffsetof(struct zip_extra_mtime, _end)\n> -#define ZIP_EXTRA_MTIME_PAYLOAD_SIZE \\\n> -\t(ZIP_EXTRA_MTIME_SIZE - offsetof(struct zip_extra_mtime, flags))\n>  #define ZIP64_EXTRA_SIZE\toffsetof(struct zip64_extra, _end)\n>  #define ZIP64_EXTRA_PAYLOAD_SIZE \\\n>  \t(ZIP64_EXTRA_SIZE - offsetof(struct zip64_extra, size))\n> @@ -299,9 +289,8 @@ static int write_zip_entry(struct archiver_args *args,\n>  {\n>  \tstruct zip_local_header header;\n>  \tuintmax_t offset = zip_offset;\n> -\tstruct zip_extra_mtime extra;\n>  \tstruct zip64_extra extra64;\n> -\tsize_t header_extra_size = ZIP_EXTRA_MTIME_SIZE;\n> +\tsize_t header_extra_size = zip_extra_mtime.len;\n>  \tint need_zip64_extra = 0;\n>  \tunsigned long attr2;\n>  \tunsigned long compressed_size;\n> @@ -315,7 +304,7 @@ static int write_zip_entry(struct archiver_args *args,\n>  \tconst char *path_without_prefix = path + args->baselen;\n>  \tunsigned int creator_version = 0;\n>  \tunsigned int version_needed = 10;\n> -\tsize_t zip_dir_extra_size = ZIP_EXTRA_MTIME_SIZE;\n> +\tsize_t zip_dir_extra_size = zip_extra_mtime.len;\n>  \tsize_t zip64_dir_extra_payload_size = 0;\n>\n>  \tcrc = crc32(0, NULL, 0);\n> @@ -381,11 +370,6 @@ static int write_zip_entry(struct archiver_args *args,\n>  \t\t}\n>  \t}\n>\n> -\tcopy_le16(extra.magic, 0x5455);\n> -\tcopy_le16(extra.extra_size, ZIP_EXTRA_MTIME_PAYLOAD_SIZE);\n> -\textra.flags[0] = 1;\t/* just mtime */\n> -\tcopy_le32(extra.mtime, args->time);\n> -\n>  \tif (size > 0xffffffff || compressed_size > 0xffffffff)\n>  \t\tneed_zip64_extra = 1;\n>  \tif (stream && size > 0x7fffffff)\n> @@ -412,8 +396,8 @@ static int write_zip_entry(struct archiver_args *args,\n>  \tzip_offset += ZIP_LOCAL_HEADER_SIZE;\n>  \twrite_or_die(1, path, pathlen);\n>  \tzip_offset += pathlen;\n> -\twrite_or_die(1, &extra, ZIP_EXTRA_MTIME_SIZE);\n> -\tzip_offset += ZIP_EXTRA_MTIME_SIZE;\n> +\twrite_or_die(1, zip_extra_mtime.buf, zip_extra_mtime.len);\n> +\tzip_offset += zip_extra_mtime.len;\n>  \tif (need_zip64_extra) {\n>  \t\tcopy_le16(extra64.magic, 0x0001);\n>  \t\tcopy_le16(extra64.extra_size, ZIP64_EXTRA_PAYLOAD_SIZE);\n> @@ -546,7 +530,7 @@ static int write_zip_entry(struct archiver_args *args,\n>  \tstrbuf_add_le(&zip_dir, 4, attr2);\n>  \tstrbuf_add_le(&zip_dir, 4, clamp32(offset));\n>  \tstrbuf_add(&zip_dir, path, pathlen);\n> -\tstrbuf_add(&zip_dir, &extra, ZIP_EXTRA_MTIME_SIZE);\n> +\tstrbuf_addbuf(&zip_dir, &zip_extra_mtime);\n>  \tif (zip64_dir_extra_payload_size) {\n>  \t\tstrbuf_add_le(&zip_dir, 2, 0x0001);\t/* magic */\n>  \t\tstrbuf_add_le(&zip_dir, 2, zip64_dir_extra_payload_size);\n> @@ -644,12 +628,21 @@ static int write_zip_archive(const struct archiver *ar UNUSED,\n>  \tdos_time(&args->time, &zip_date, &zip_time);\n>\n>  \tstrbuf_init(&zip_dir, 0);\n> +\tstrbuf_init(&zip_extra_mtime, 0);\n> +\n> +\tif (args->time <= 0x7fffffff) {\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 2, 0x5455); /* magic */\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 2, 1 + 4); /* payload size */\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 1, 1); /* flags; just mtime */\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 4, args->time);\n> +\t}\n>\n>  \terr = write_archive_entries(args, write_zip_entry);\n>  \tif (!err)\n>  \t\twrite_zip_trailer(args->commit_oid);\n>\n>  \tstrbuf_release(&zip_dir);\n> +\tstrbuf_release(&zip_extra_mtime);\n>\n>  \treturn err;\n>  }\n> diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\n> index 768b0ff85d..20bab21048 100755\n> --- a/t/t5004-archive-corner-cases.sh\n> +++ b/t/t5004-archive-corner-cases.sh\n> @@ -227,4 +227,32 @@ test_expect_success 'tar archive with long paths' '\n>  \tgit archive -o long_paths.tar $tree\n>  '\n>\n> +test_lazy_prereq ZIPINFO_UT_EXTRA '\n> +\t\"$ZIPINFO\" -v \"$TEST_DIRECTORY\"/t5004/big-pack.zip |\n> +\tgrep \"UT extra field modtime\"\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n> +\tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n> +\tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA 'UT extra field' '\n> +\t\"$ZIPINFO\" -v with_ut_extra.zip >actual &&\n> +\ttest_grep \"UT extra field modtime\" actual\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA \\\n> +\t'UT extra field omitted when mtime exceeds 32-bit' '\n> +\t\"$ZIPINFO\" -v without_ut_extra.zip >actual &&\n> +\ttest_grep ! \"UT extra field modtime\" actual\n> +'\n> +\n>  test_done\n> --\n> 2.56.0\n\n"},{"id":"554760","messageId":"3a7868a2-a65d-4540-8ab1-70cfbae9754f@web.de","threadId":"66464","inReplyTo":"87jynn8ycv.fsf@gitster.g","subject":"Re: [PATCH] archive-zip: omit UT extra field if mtime is out of range","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-10-12T14:39:56Z","receivedAt":"2026-10-12T14:39:56Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"On 10/12/26 4:08 AM, Junio C Hamano wrote:\n> René Scharfe <l.s.r@web.de> writes:\n> \n>> diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\n>> index 768b0ff85d..20bab21048 100755\n>> --- a/t/t5004-archive-corner-cases.sh\n>> +++ b/t/t5004-archive-corner-cases.sh\n>> @@ -227,4 +227,32 @@ test_expect_success 'tar archive with long paths' '\n>>  \tgit archive -o long_paths.tar $tree\n>>  '\n>>  \n>> +test_lazy_prereq ZIPINFO_UT_EXTRA '\n>> +\t\"$ZIPINFO\" -v \"$TEST_DIRECTORY\"/t5004/big-pack.zip |\n>> +\tgrep \"UT extra field modtime\"\n>> +'\n>> +\n>> +test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n>> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n>> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n>> +\tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n>> +'\n>> +\n>> +test_expect_success TIME_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n>> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n>> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n>> +\tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n>> +'\n> \n> Both Ubuntu/20.02 i386 (which is going away so you do not have to\n> deeply care) and Debian/latest i386 (which we plan to use to replace\n> the Ubuntu/20.02 i386, so it would be superb to get it work) jobs\n> seem to fail this one.\n> \n> https://github.com/git/git/actions/runs/38189684665/job/114619579067#step:10:321\n> https://github.com/git/git/actions/runs/38189685137/job/114619583658#step:10:337\ngit archive --mtime=\"@2147483648 +0000\" fails in these runs with \"fatal:\ntimestamp too large for this system: 18446744071562067968, which looks\nlike a preexisting bug.  I suspect the time_t conversion in dos_time().\nWill take a deeper look later this week.\n\nRené\n\n\n"},{"id":"554761","messageId":"0334c031-56e3-4c8d-8adc-52051d2e26aa@web.de","threadId":"66464","inReplyTo":"CA+h9NxRQLP=20kfmSm6B2WtkkmHDCfdRDZEawOpzFF1LoghTEA@mail.gmail.com","subject":"Re: [PATCH] archive-zip: omit UT extra field if mtime is out of range","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-10-12T14:45:12Z","receivedAt":"2026-10-12T14:45:12Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"On 10/12/26 2:56 PM, m@sph3r3.com wrote:\n> Thanks for the patch. I confirmed that it fixes the 2106 case: before\n> the change, UT wrapped to zero and unzip -u retained the existing 2025\n> file; afterward, UT is omitted and the file is replaced correctly.\n\nThanks for checking!\n\n> For the i386 failure Junio reported, the beyond-2038 archive test and\n> its dependent omission check should use TIME_T_IS_64BIT. TIME_IS_64BIT\n> checks Git's timestamp_t, which can be 64-bit while time_t is 32-bit.\n> \n> With that two-line adjustment, all 18 t5004 tests pass on x86-64\n> Linux. Forcing TIME_T_IS_64BIT off skips only those two tests; the\n> other 16 pass, including both INT32_MAX checks. I haven't run a native\n> 32-bit build.\nThat would be an easy way out, nice!  I suspect git archive should not\neven use time_t in this context, though.\n\nRené\n\n\n"},{"id":"554769","messageId":"xmqqpkxf9ctv.fsf@gitster.g","threadId":"66464","inReplyTo":"CA+h9NxRQLP=20kfmSm6B2WtkkmHDCfdRDZEawOpzFF1LoghTEA@mail.gmail.com","subject":"Re: [PATCH] archive-zip: omit UT extra field if mtime is out of range","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-12T15:07:56Z","receivedAt":"2026-10-12T15:07:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"m@sph3r3.com writes:\n\n> For the i386 failure Junio reported, the beyond-2038 archive test and\n> its dependent omission check should use TIME_T_IS_64BIT. TIME_IS_64BIT\n> checks Git's timestamp_t, which can be 64-bit while time_t is 32-bit.\n\n;-)\n\nThanks.  It is an obvious thing, only once it is pointed out X-<.\n\nThese two prerequisites sound too similar, and the latter probably\nis no longer very relevant in the modern world, but that was what\nwas used in the test.\n\nTIME_T_IS_64BIT measures how wide sizeof(time_t) is, which makes\nsense as a portability test across platforms.\n\nBut TIME_IS_64BIT?  It measures how wide sizeof(timestamp_t) is, but\nthe thing is, it is uintmax_t everywhere as far as \"git grep\" can see.\n\n        $ git grep -n -e 'typedef .*timestamp_t' :/\n        compat/posix.h:267:typedef uintmax_t timestamp_t;\n        $ git grep -n -e timestamp_t\\; :/\\*.h\n        compat/posix.h:267:typedef uintmax_t timestamp_t;\n\nSo TIME_IS_64BIT can be true even if TIME_T_IS_64BIT is not.  Unless\nwe are on a platform where uintmax_t is 32-bit wide, TIME_IS_64BIT\nwould be true.  And the time value from the system that is delibered\nto us initially in time_t would be limited by that even if timestamp_t\nis wider.  TIME_IS_64BIT would not have much value as TIME_T_IS_64BIT\nas a portability guard to tests that require wider time values across\nthe callstack.\n\nPerhaps we should audit places where timestamp_t value is read from\nSCM data and coerced into time_t to expose it in a form that outside\nworld (like ZIP archive format) would understand and warn when we\ntruncate values?  I will leave it as #leftoverbits for others to\nthink about it through ;-).\n\nThanks.\n\n"},{"id":"555440","messageId":"c873cb77-10ed-40fa-b1a1-b3e01d341bc3@web.de","threadId":"66464","inReplyTo":"0334c031-56e3-4c8d-8adc-52051d2e26aa@web.de","subject":"Re: [PATCH] archive-zip: omit UT extra field if mtime is out of range","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-10-19T17:11:02Z","receivedAt":"2026-10-19T17:11:02Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"On 10/12/26 4:45 PM, René Scharfe wrote:\n> On 10/12/26 2:56 PM, m@sph3r3.com wrote:\n>> For the i386 failure Junio reported, the beyond-2038 archive test and\n>> its dependent omission check should use TIME_T_IS_64BIT. TIME_IS_64BIT\n>> checks Git's timestamp_t, which can be 64-bit while time_t is 32-bit.\n>>\n>> With that two-line adjustment, all 18 t5004 tests pass on x86-64\n>> Linux. Forcing TIME_T_IS_64BIT off skips only those two tests; the\n>> other 16 pass, including both INT32_MAX checks. I haven't run a native\n>> 32-bit build.\n> > That would be an easy way out, nice!  I suspect git archive should not\n> even use time_t in this context, though.\nGetting rid of time_t in archive-zip.c is possible, but would require\nsupplying a 64-bit version of localtime_r(3) on 32-bit platforms, which\nseems excessive.  The task would be simpler if we picked a time zone,\nsay UTC, instead of capturing the time zone of the archiver, which is\nquestionable in the first place.  That would change the output,\nbreaking caching schemes.  In any case, getting rid of time_t would be\ntoo much work or trouble just to enable two tests.  So right, let's add\nthat requirement for now.\n\nRené\n\n\n"},{"id":"555441","messageId":"e25693e2-1e32-46ae-945f-0a83b382e8a2@web.de","threadId":"66464","inReplyTo":"CA+h9NxRT-9QzLGihdL_Bp-yyt1AdXJ79YYgpK-OaegUz8e+HcA@mail.gmail.com","subject":"[PATCH v2] archive-zip: omit UT extra field if mtime is out of range","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2026-10-19T17:11:21Z","receivedAt":"2026-10-19T17:11:21Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"We write an Extended Timestamp Extra Field (ID 0x5455 = \"UT\") for each\nzip entry, like Info-ZIP zip(1) does.  Its time values are signed 32-bit\nintegers (see e.g. https://libzip.org/specifications/extrafld.txt).\nStop emitting them when the commit time doesn't fit in.\n\nUse a strbuf to prepare the extra field up front.  Keep it empty if the\ntime value is out of range.  Like for the central zip directory we only\ncare about the length-limited buffer aspect of the strbuf, not about\nNUL-termination.  This simplifies the conditional output by avoiding to\nrepeat the condition.\n\nReported-by: Matthew E. Luallen <m@sph3r3.com>\nHelped-by: Matthew E. Luallen <m@sph3r3.com>\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\nChanges since v1:\n- skip tests of 33-bit timestamp on 32-bit architectures\n\n archive-zip.c                   | 37 +++++++++++++--------------------\n t/t5004-archive-corner-cases.sh | 28 +++++++++++++++++++++++++\n 2 files changed, 43 insertions(+), 22 deletions(-)\n\ndiff --git a/archive-zip.c b/archive-zip.c\nindex 6f73ca6d58..785689584c 100644\n--- a/archive-zip.c\n+++ b/archive-zip.c\n@@ -24,6 +24,7 @@ static int zip_time;\n \n /* We only care about the \"buf\" part here. */\n static struct strbuf zip_dir;\n+static struct strbuf zip_extra_mtime;\n \n static uintmax_t zip_offset;\n static uint64_t zip_dir_entries;\n@@ -81,14 +82,6 @@ struct zip_dir_trailer {\n \tunsigned char _end[1];\n };\n \n-struct zip_extra_mtime {\n-\tunsigned char magic[2];\n-\tunsigned char extra_size[2];\n-\tunsigned char flags[1];\n-\tunsigned char mtime[4];\n-\tunsigned char _end[1];\n-};\n-\n struct zip64_extra {\n \tunsigned char magic[2];\n \tunsigned char extra_size[2];\n@@ -129,9 +122,6 @@ struct zip64_dir_trailer_locator {\n #define ZIP64_DATA_DESC_SIZE\toffsetof(struct zip64_data_desc, _end)\n #define ZIP_DIR_HEADER_SIZE\toffsetof(struct zip_dir_header, _end)\n #define ZIP_DIR_TRAILER_SIZE\toffsetof(struct zip_dir_trailer, _end)\n-#define ZIP_EXTRA_MTIME_SIZE\toffsetof(struct zip_extra_mtime, _end)\n-#define ZIP_EXTRA_MTIME_PAYLOAD_SIZE \\\n-\t(ZIP_EXTRA_MTIME_SIZE - offsetof(struct zip_extra_mtime, flags))\n #define ZIP64_EXTRA_SIZE\toffsetof(struct zip64_extra, _end)\n #define ZIP64_EXTRA_PAYLOAD_SIZE \\\n \t(ZIP64_EXTRA_SIZE - offsetof(struct zip64_extra, size))\n@@ -299,9 +289,8 @@ static int write_zip_entry(struct archiver_args *args,\n {\n \tstruct zip_local_header header;\n \tuintmax_t offset = zip_offset;\n-\tstruct zip_extra_mtime extra;\n \tstruct zip64_extra extra64;\n-\tsize_t header_extra_size = ZIP_EXTRA_MTIME_SIZE;\n+\tsize_t header_extra_size = zip_extra_mtime.len;\n \tint need_zip64_extra = 0;\n \tunsigned long attr2;\n \tunsigned long compressed_size;\n@@ -315,7 +304,7 @@ static int write_zip_entry(struct archiver_args *args,\n \tconst char *path_without_prefix = path + args->baselen;\n \tunsigned int creator_version = 0;\n \tunsigned int version_needed = 10;\n-\tsize_t zip_dir_extra_size = ZIP_EXTRA_MTIME_SIZE;\n+\tsize_t zip_dir_extra_size = zip_extra_mtime.len;\n \tsize_t zip64_dir_extra_payload_size = 0;\n \n \tcrc = crc32(0, NULL, 0);\n@@ -381,11 +370,6 @@ static int write_zip_entry(struct archiver_args *args,\n \t\t}\n \t}\n \n-\tcopy_le16(extra.magic, 0x5455);\n-\tcopy_le16(extra.extra_size, ZIP_EXTRA_MTIME_PAYLOAD_SIZE);\n-\textra.flags[0] = 1;\t/* just mtime */\n-\tcopy_le32(extra.mtime, args->time);\n-\n \tif (size > 0xffffffff || compressed_size > 0xffffffff)\n \t\tneed_zip64_extra = 1;\n \tif (stream && size > 0x7fffffff)\n@@ -412,8 +396,8 @@ static int write_zip_entry(struct archiver_args *args,\n \tzip_offset += ZIP_LOCAL_HEADER_SIZE;\n \twrite_or_die(1, path, pathlen);\n \tzip_offset += pathlen;\n-\twrite_or_die(1, &extra, ZIP_EXTRA_MTIME_SIZE);\n-\tzip_offset += ZIP_EXTRA_MTIME_SIZE;\n+\twrite_or_die(1, zip_extra_mtime.buf, zip_extra_mtime.len);\n+\tzip_offset += zip_extra_mtime.len;\n \tif (need_zip64_extra) {\n \t\tcopy_le16(extra64.magic, 0x0001);\n \t\tcopy_le16(extra64.extra_size, ZIP64_EXTRA_PAYLOAD_SIZE);\n@@ -546,7 +530,7 @@ static int write_zip_entry(struct archiver_args *args,\n \tstrbuf_add_le(&zip_dir, 4, attr2);\n \tstrbuf_add_le(&zip_dir, 4, clamp32(offset));\n \tstrbuf_add(&zip_dir, path, pathlen);\n-\tstrbuf_add(&zip_dir, &extra, ZIP_EXTRA_MTIME_SIZE);\n+\tstrbuf_addbuf(&zip_dir, &zip_extra_mtime);\n \tif (zip64_dir_extra_payload_size) {\n \t\tstrbuf_add_le(&zip_dir, 2, 0x0001);\t/* magic */\n \t\tstrbuf_add_le(&zip_dir, 2, zip64_dir_extra_payload_size);\n@@ -644,12 +628,21 @@ static int write_zip_archive(const struct archiver *ar UNUSED,\n \tdos_time(&args->time, &zip_date, &zip_time);\n \n \tstrbuf_init(&zip_dir, 0);\n+\tstrbuf_init(&zip_extra_mtime, 0);\n+\n+\tif (args->time <= 0x7fffffff) {\n+\t\tstrbuf_add_le(&zip_extra_mtime, 2, 0x5455); /* magic */\n+\t\tstrbuf_add_le(&zip_extra_mtime, 2, 1 + 4); /* payload size */\n+\t\tstrbuf_add_le(&zip_extra_mtime, 1, 1); /* flags; just mtime */\n+\t\tstrbuf_add_le(&zip_extra_mtime, 4, args->time);\n+\t}\n \n \terr = write_archive_entries(args, write_zip_entry);\n \tif (!err)\n \t\twrite_zip_trailer(args->commit_oid);\n \n \tstrbuf_release(&zip_dir);\n+\tstrbuf_release(&zip_extra_mtime);\n \n \treturn err;\n }\ndiff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\nindex 768b0ff85d..c776387ad6 100755\n--- a/t/t5004-archive-corner-cases.sh\n+++ b/t/t5004-archive-corner-cases.sh\n@@ -227,4 +227,32 @@ test_expect_success 'tar archive with long paths' '\n \tgit archive -o long_paths.tar $tree\n '\n \n+test_lazy_prereq ZIPINFO_UT_EXTRA '\n+\t\"$ZIPINFO\" -v \"$TEST_DIRECTORY\"/t5004/big-pack.zip |\n+\tgrep \"UT extra field modtime\"\n+'\n+\n+test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n+\tblob=$(echo foo | git hash-object -w --stdin) &&\n+\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n+\tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n+'\n+\n+test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n+\tblob=$(echo foo | git hash-object -w --stdin) &&\n+\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n+\tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n+'\n+\n+test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA 'UT extra field' '\n+\t\"$ZIPINFO\" -v with_ut_extra.zip >actual &&\n+\ttest_grep \"UT extra field modtime\" actual\n+'\n+\n+test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT,ZIPINFO_UT_EXTRA \\\n+\t'UT extra field omitted when mtime exceeds 32-bit' '\n+\t\"$ZIPINFO\" -v without_ut_extra.zip >actual &&\n+\ttest_grep ! \"UT extra field modtime\" actual\n+'\n+\n test_done\n\nInterdiff against v1:\n  diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\n  index 20bab21048..c776387ad6 100755\n  --- a/t/t5004-archive-corner-cases.sh\n  +++ b/t/t5004-archive-corner-cases.sh\n  @@ -238,7 +238,7 @@ test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n   \tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n   '\n   \n  -test_expect_success TIME_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n  +test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n   \tblob=$(echo foo | git hash-object -w --stdin) &&\n   \ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n   \tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n  @@ -249,7 +249,7 @@ test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA 'UT extra field' '\n   \ttest_grep \"UT extra field modtime\" actual\n   '\n   \n  -test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA \\\n  +test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT,ZIPINFO_UT_EXTRA \\\n   \t'UT extra field omitted when mtime exceeds 32-bit' '\n   \t\"$ZIPINFO\" -v without_ut_extra.zip >actual &&\n   \ttest_grep ! \"UT extra field modtime\" actual\n-- \n2.56.0\n\n"},{"id":"555498","messageId":"CA+h9NxT1A5fiJ1=B2e9QoYq_8SE9B2erKs+Lh19RPrh6Eq_GKA@mail.gmail.com","threadId":"66464","inReplyTo":"e25693e2-1e32-46ae-945f-0a83b382e8a2@web.de","subject":"Re: [PATCH v2] archive-zip: omit UT extra field if mtime is out of range","fromName":"","fromEmail":"m@sph3r3.com","sentAt":"2026-10-20T06:13:52Z","receivedAt":"2026-10-20T06:13:52Z","isPatch":true,"sender":{"key":"m@sph3r3.com","avatar":null},"body":"René,\n\nThanks for updating this. I retested v2 and confirmed it fixes the\noriginal 2106 case. The older file now gets replaced as expected.\n\nI also found a separate time-zone issue with post-2038 dates when\nusing unzip -u. I don’t think that needs to hold up this fix; we can\ntrack it separately.\n\nMatt\n\nOn Mon, 19 Oct 2026 19:11:21 +0200, René Scharfe <l.s.r@web.de> wrote:\n> We write an Extended Timestamp Extra Field (ID 0x5455 = \"UT\") for each\n> zip entry, like Info-ZIP zip(1) does.  Its time values are signed 32-bit\n> integers (see e.g. https://libzip.org/specifications/extrafld.txt).\n> Stop emitting them when the commit time doesn't fit in.\n>\n> Use a strbuf to prepare the extra field up front.  Keep it empty if the\n> time value is out of range.  Like for the central zip directory we only\n> care about the length-limited buffer aspect of the strbuf, not about\n> NUL-termination.  This simplifies the conditional output by avoiding to\n> repeat the condition.\n>\n> Reported-by: Matthew E. Luallen <m@sph3r3.com>\n> Helped-by: Matthew E. Luallen <m@sph3r3.com>\n> Signed-off-by: René Scharfe <l.s.r@web.de>\n> ---\n> Changes since v1:\n> - skip tests of 33-bit timestamp on 32-bit architectures\n>\n>  archive-zip.c                   | 37 +++++++++++++--------------------\n>  t/t5004-archive-corner-cases.sh | 28 +++++++++++++++++++++++++\n>  2 files changed, 43 insertions(+), 22 deletions(-)\n>\n> diff --git a/archive-zip.c b/archive-zip.c\n> index 6f73ca6d58..785689584c 100644\n> --- a/archive-zip.c\n> +++ b/archive-zip.c\n> @@ -24,6 +24,7 @@ static int zip_time;\n>\n>  /* We only care about the \"buf\" part here. */\n>  static struct strbuf zip_dir;\n> +static struct strbuf zip_extra_mtime;\n>\n>  static uintmax_t zip_offset;\n>  static uint64_t zip_dir_entries;\n> @@ -81,14 +82,6 @@ struct zip_dir_trailer {\n>  \tunsigned char _end[1];\n>  };\n>\n> -struct zip_extra_mtime {\n> -\tunsigned char magic[2];\n> -\tunsigned char extra_size[2];\n> -\tunsigned char flags[1];\n> -\tunsigned char mtime[4];\n> -\tunsigned char _end[1];\n> -};\n> -\n>  struct zip64_extra {\n>  \tunsigned char magic[2];\n>  \tunsigned char extra_size[2];\n> @@ -129,9 +122,6 @@ struct zip64_dir_trailer_locator {\n>  #define ZIP64_DATA_DESC_SIZE\toffsetof(struct zip64_data_desc, _end)\n>  #define ZIP_DIR_HEADER_SIZE\toffsetof(struct zip_dir_header, _end)\n>  #define ZIP_DIR_TRAILER_SIZE\toffsetof(struct zip_dir_trailer, _end)\n> -#define ZIP_EXTRA_MTIME_SIZE\toffsetof(struct zip_extra_mtime, _end)\n> -#define ZIP_EXTRA_MTIME_PAYLOAD_SIZE \\\n> -\t(ZIP_EXTRA_MTIME_SIZE - offsetof(struct zip_extra_mtime, flags))\n>  #define ZIP64_EXTRA_SIZE\toffsetof(struct zip64_extra, _end)\n>  #define ZIP64_EXTRA_PAYLOAD_SIZE \\\n>  \t(ZIP64_EXTRA_SIZE - offsetof(struct zip64_extra, size))\n> @@ -299,9 +289,8 @@ static int write_zip_entry(struct archiver_args *args,\n>  {\n>  \tstruct zip_local_header header;\n>  \tuintmax_t offset = zip_offset;\n> -\tstruct zip_extra_mtime extra;\n>  \tstruct zip64_extra extra64;\n> -\tsize_t header_extra_size = ZIP_EXTRA_MTIME_SIZE;\n> +\tsize_t header_extra_size = zip_extra_mtime.len;\n>  \tint need_zip64_extra = 0;\n>  \tunsigned long attr2;\n>  \tunsigned long compressed_size;\n> @@ -315,7 +304,7 @@ static int write_zip_entry(struct archiver_args *args,\n>  \tconst char *path_without_prefix = path + args->baselen;\n>  \tunsigned int creator_version = 0;\n>  \tunsigned int version_needed = 10;\n> -\tsize_t zip_dir_extra_size = ZIP_EXTRA_MTIME_SIZE;\n> +\tsize_t zip_dir_extra_size = zip_extra_mtime.len;\n>  \tsize_t zip64_dir_extra_payload_size = 0;\n>\n>  \tcrc = crc32(0, NULL, 0);\n> @@ -381,11 +370,6 @@ static int write_zip_entry(struct archiver_args *args,\n>  \t\t}\n>  \t}\n>\n> -\tcopy_le16(extra.magic, 0x5455);\n> -\tcopy_le16(extra.extra_size, ZIP_EXTRA_MTIME_PAYLOAD_SIZE);\n> -\textra.flags[0] = 1;\t/* just mtime */\n> -\tcopy_le32(extra.mtime, args->time);\n> -\n>  \tif (size > 0xffffffff || compressed_size > 0xffffffff)\n>  \t\tneed_zip64_extra = 1;\n>  \tif (stream && size > 0x7fffffff)\n> @@ -412,8 +396,8 @@ static int write_zip_entry(struct archiver_args *args,\n>  \tzip_offset += ZIP_LOCAL_HEADER_SIZE;\n>  \twrite_or_die(1, path, pathlen);\n>  \tzip_offset += pathlen;\n> -\twrite_or_die(1, &extra, ZIP_EXTRA_MTIME_SIZE);\n> -\tzip_offset += ZIP_EXTRA_MTIME_SIZE;\n> +\twrite_or_die(1, zip_extra_mtime.buf, zip_extra_mtime.len);\n> +\tzip_offset += zip_extra_mtime.len;\n>  \tif (need_zip64_extra) {\n>  \t\tcopy_le16(extra64.magic, 0x0001);\n>  \t\tcopy_le16(extra64.extra_size, ZIP64_EXTRA_PAYLOAD_SIZE);\n> @@ -546,7 +530,7 @@ static int write_zip_entry(struct archiver_args *args,\n>  \tstrbuf_add_le(&zip_dir, 4, attr2);\n>  \tstrbuf_add_le(&zip_dir, 4, clamp32(offset));\n>  \tstrbuf_add(&zip_dir, path, pathlen);\n> -\tstrbuf_add(&zip_dir, &extra, ZIP_EXTRA_MTIME_SIZE);\n> +\tstrbuf_addbuf(&zip_dir, &zip_extra_mtime);\n>  \tif (zip64_dir_extra_payload_size) {\n>  \t\tstrbuf_add_le(&zip_dir, 2, 0x0001);\t/* magic */\n>  \t\tstrbuf_add_le(&zip_dir, 2, zip64_dir_extra_payload_size);\n> @@ -644,12 +628,21 @@ static int write_zip_archive(const struct archiver *ar UNUSED,\n>  \tdos_time(&args->time, &zip_date, &zip_time);\n>\n>  \tstrbuf_init(&zip_dir, 0);\n> +\tstrbuf_init(&zip_extra_mtime, 0);\n> +\n> +\tif (args->time <= 0x7fffffff) {\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 2, 0x5455); /* magic */\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 2, 1 + 4); /* payload size */\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 1, 1); /* flags; just mtime */\n> +\t\tstrbuf_add_le(&zip_extra_mtime, 4, args->time);\n> +\t}\n>\n>  \terr = write_archive_entries(args, write_zip_entry);\n>  \tif (!err)\n>  \t\twrite_zip_trailer(args->commit_oid);\n>\n>  \tstrbuf_release(&zip_dir);\n> +\tstrbuf_release(&zip_extra_mtime);\n>\n>  \treturn err;\n>  }\n> diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\n> index 768b0ff85d..c776387ad6 100755\n> --- a/t/t5004-archive-corner-cases.sh\n> +++ b/t/t5004-archive-corner-cases.sh\n> @@ -227,4 +227,32 @@ test_expect_success 'tar archive with long paths' '\n>  \tgit archive -o long_paths.tar $tree\n>  '\n>\n> +test_lazy_prereq ZIPINFO_UT_EXTRA '\n> +\t\"$ZIPINFO\" -v \"$TEST_DIRECTORY\"/t5004/big-pack.zip |\n> +\tgrep \"UT extra field modtime\"\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n> +\tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n> +\tblob=$(echo foo | git hash-object -w --stdin) &&\n> +\ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n> +\tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA 'UT extra field' '\n> +\t\"$ZIPINFO\" -v with_ut_extra.zip >actual &&\n> +\ttest_grep \"UT extra field modtime\" actual\n> +'\n> +\n> +test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT,ZIPINFO_UT_EXTRA \\\n> +\t'UT extra field omitted when mtime exceeds 32-bit' '\n> +\t\"$ZIPINFO\" -v without_ut_extra.zip >actual &&\n> +\ttest_grep ! \"UT extra field modtime\" actual\n> +'\n> +\n>  test_done\n>\n> Interdiff against v1:\n>   diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh\n>   index 20bab21048..c776387ad6 100755\n>   --- a/t/t5004-archive-corner-cases.sh\n>   +++ b/t/t5004-archive-corner-cases.sh\n>   @@ -238,7 +238,7 @@ test_expect_success TIME_IS_64BIT 'zip archive with 32-bit mtime' '\n>    \tgit archive --mtime=\"@2147483647 +0000\" -o with_ut_extra.zip $tree\n>    '\n>\n>   -test_expect_success TIME_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n>   +test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT 'zip archive with mtime exceeding 32-bit' '\n>    \tblob=$(echo foo | git hash-object -w --stdin) &&\n>    \ttree=$(printf \"100644 blob $blob\\tfile\" | git mktree) &&\n>    \tgit archive --mtime=\"@2147483648 +0000\" -o without_ut_extra.zip $tree\n>   @@ -249,7 +249,7 @@ test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA 'UT extra field' '\n>    \ttest_grep \"UT extra field modtime\" actual\n>    '\n>\n>   -test_expect_success TIME_IS_64BIT,ZIPINFO_UT_EXTRA \\\n>   +test_expect_success TIME_IS_64BIT,TIME_T_IS_64BIT,ZIPINFO_UT_EXTRA \\\n>    \t'UT extra field omitted when mtime exceeds 32-bit' '\n>    \t\"$ZIPINFO\" -v without_ut_extra.zip >actual &&\n>    \ttest_grep ! \"UT extra field modtime\" actual\n> --\n> 2.56.0\n\n"},{"id":"558961","messageId":"20261120161227.58989-1-aniketgupta3001@gmail.com","threadId":"66464","inReplyTo":"f8dc40a4-920d-4dc5-9f71-7686bfc6255b@web.de","subject":"Re: [BUG] ZIP timestamp conversion and strict fast-import date validation","fromName":"Aniket Gupta","fromEmail":"aniketgupta3001@gmail.com","sentAt":"2026-11-20T16:12:27Z","receivedAt":"2026-11-20T16:12:27Z","isPatch":false,"sender":{"key":"aniketgupta3001@gmail.com","avatar":null},"body":"Hi René,\n\n> The latter function contains two NEEDSWORK\n> comments about perhaps adding more checks, though.\n\nIt seems nobody is onto this and I would like to take this part. I will send a patch so that plain \"raw\" rejects dates that fsck rejects and leave \"raw-permissive\" alone.\n\nThanks,\nAniket\n\n"}]}