-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zip: dates 00-00-1980 are (in)valid? #562
Comments
I guess
and create |
By the way, DOS itself and Windows 95 "support" zeroed out datetimes on FAT disks, to some extent. If a file has an all-zero modification time, When listing ZIP files or FAT disk images, 7-Zip behaves similarly and also displays all-zero DOS datetimes as blank fields. Since there are modern ZIP files that use these zeroed-out datetimes, and at least some popular tools can handle this case, I think we shouldn't block this entirely. Maybe we should remove the |
Could you also test OS reaction on tampered fs with components not entirely zeroed out?
How about more modern OSes? |
I've created a few ZIP files to test this:
See the attached file zip-datetime-samples.tar.gz. Looking at the created archives in Windows Explorer and 7-Zip, apparently any invalid datetime behaves the same as the zeroed out. So the last modified date is only displayed if it's valid, otherwise it's hidden. From this standpoint, I think that there isn't anything special about the "datetime" So this should be an ideal behavior of the KS implementation as well. Failure to meet the constraint set by the
is the next best thing, and I would totally go for this option for now. However, I feel that it's not ideal - in comparison to Therefore, I think that the Moreover, it wouldn't be useful only for |
0 months, 0 days, etcetera. See kaitai-io/kaitai_struct_formats#562 for more information
Just noting for reference: the ZIP specification also says in section 4.4.6 that there are certain situations where this field will only contain zeroes. |
I am not sure whether or not to file this one against
zip.ksy
or/common/dos_datetime.ksy
, so perhaps it needs to be moved.I am currently looking at the contents of a ZIP-file inside a Chrome extension. In
zip.ksy
the standard MS-DOS format is used for the date in (amongst others) the local file header. In the example I am looking at ( https://github.com/GoogleChrome/chrome-extensions-samples/blob/main/mv2-archive/api/permissions/extension-questions.crx ) I can see the following:In
/common/dos_datetime.ksy
there are these sanity checks:and that obviously fails.
There are three solutions:
/common/dos_datetime.ksy
- perhaps this isn't correct eitherdos_datetime
in the ZIP specification - not ideal, but perhaps the bestThe text was updated successfully, but these errors were encountered: