Created attachment 1279853 [details] Attachment created by example. Description of problem: Unzip will sometimes round up timestamps of unpacked files. This results in a 1 second difference between the timestamp shown via zipinfo -T, and the unzipped file on disk Version-Release number of selected component (if applicable): zip-3.0-16.fc24.x86_64 unzip-6.0-31.fc25.x86_64 How reproducible: Very Steps to Reproduce: 1. Zip files with different timestamps. 2. Note the timestamps stored in the archive with `zipinfo -T` 3. Unzip the archive 4. Compare the timestamps with `ls --full-time` 5. Note a difference of 1 second on some files. (Perhaps rounding up?) Actual results: Timestamps are off by a second on some files Expected results: Timestamps should match between zipinfo and ls. Additional info: Example -- note the timestamps on file "1" $ touch 1 $ zip test.zip 1 adding: 1 (stored 0%) $ touch 2 $ zip test.zip 2 adding: 2 (stored 0%) $ touch 3 $ zip test.zip 3 adding: 3 (stored 0%) $ ls --full-time total 4 -rw-r--r--. 1 root root 0 2017-05-17 20:56:03.581961297 -0500 1 -rw-r--r--. 1 root root 0 2017-05-17 20:56:12.893885812 -0500 2 -rw-r--r--. 1 root root 0 2017-05-17 20:56:16.116859685 -0500 3 -rw-r--r--. 1 root root 412 2017-05-17 20:56:17.289850177 -0500 test.zip $ rm -f 1 2 3 $ unzip test.zip Archive: test.zip extracting: 1 extracting: 2 extracting: 3 $ ls --full-time total 4 -rw-r--r--. 1 root root 0 2017-05-17 20:56:04.000000000 -0500 1 -rw-r--r--. 1 root root 0 2017-05-17 20:56:12.000000000 -0500 2 -rw-r--r--. 1 root root 0 2017-05-17 20:56:16.000000000 -0500 3 -rw-r--r--. 1 root root 412 2017-05-17 20:56:17.289850177 -0500 test.zip $ zipinfo -T test.zip Archive: test.zip Zip file size: 412 bytes, number of entries: 3 -rw-r--r-- 3.0 unx 0 bx stor 20170517.205603 1 -rw-r--r-- 3.0 unx 0 bx stor 20170517.205612 2 -rw-r--r-- 3.0 unx 0 bx stor 20170517.205616 3 3 files, 0 bytes uncompressed, 0 bytes compressed: 0.0% $ cat /etc/os-release NAME=Fedora VERSION="25 (Server Edition)" ID=fedora VERSION_ID=25 PRETTY_NAME="Fedora 25 (Server Edition)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:fedoraproject:fedora:25" HOME_URL="https://fedoraproject.org/" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=25 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=25 PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy VARIANT="Server Edition" VARIANT_ID=server $ rpm -q zip unzip zip-3.0-16.fc24.x86_64 unzip-6.0-31.fc25.x86_64
Although `zip` stores both the legacy ZIP "DOS" timestamp (with 2-second precision) and an extension block with proper Unix timestamp, `unzip` is not using the latter during extraction because of a bug. Apart from the possible 1 second difference this has also negative implications when working across multiple time zones. Because the legacy timestamp uses local time zone, when e.g. someone packs source code in UTC+2 and someone else uses it later in UTC-8, their project will be always rebuilding for the next 10 hours, because `make` thinks the sources are still newer than the build outputs. Unfortunately it seems the upstream Info-ZIP folks still don't have anything like a repo to check for updates since 2009, but luckily Debian already has a patch for this: http://sources.debian.net/patches/unzip/6.0-21/17-restore-unix-timestamps-accurately.patch/ I have verified their version 6.0-21 does the right thing. Thanks for your consideration.
Thanks Jirka for your time & investigation. Yes, repositories of (un)zip are not public and probably will not be.
unzip-6.0-34.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-28fd8ef47d
unzip-6.0-32.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-077cbd8617
unzip-6.0-32.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-077cbd8617
unzip-6.0-34.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-28fd8ef47d
unzip-6.0-34.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.
unzip-6.0-32.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.