Bug 450125 - When extracting ZIPs with empty folders, access time is set to future (year 4443302 or 4444523)
Summary: When extracting ZIPs with empty folders, access time is set to future (year 4...
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: plugins (show other bugs)
Version: 21.12.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Ragnar Thomsen
URL:
Keywords:
: 424740 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-13 05:39 UTC by nyanpasu64
Modified: 2022-02-21 16:10 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.12.3
Sentry Crash Report:


Attachments
.zip file containing folders with no files (498 bytes, application/zip)
2022-02-13 11:39 UTC, nyanpasu64
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nyanpasu64 2022-02-13 05:39:33 UTC
SUMMARY
When I extract a ZIP, and a folder contains no files (is empty or only contains folders), the folder's access time is set in the future.

(4444523-03-02 04:58:56.000000000 -0800)

STEPS TO REPRODUCE
1. Download the attached .zip file.
2. Open it in Ark and extract all. Alternatively, extract it using Dolphin's "Extract archive here, autodetect subfolder".
3. Run `stat folders-only`. Optionally check `folders-only/empty` and `folders-only/has-files` as well.
4. Try viewing the folder in Wine.

OBSERVED RESULT
When extracting folders without files inside, their access time is in the future. If extracted in Ark, the access time is 4443302-06-30 03:35:44.000000000 -0700. If extracted using Dolphin, the access time is 4444521-01-12 12:13:04.000000000 -0800.

Wine applications cannot access the contents of folders with access times past 2038, failing with errno 75 EOVERFLOW. I think this is a Wine bug.

EXPECTED RESULT
The access time of folders without files inside is reasonable.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.0
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.8-zen1-1-zen (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2

ADDITIONAL INFORMATION
I think this does not happen when extracting .tar.gz or .7z files.
Comment 1 Albert Astals Cid 2022-02-13 11:36:52 UTC
Please attach the zip file
Comment 2 nyanpasu64 2022-02-13 11:39:35 UTC
Created attachment 146666 [details]
.zip file containing folders with no files
Comment 3 Albert Astals Cid 2022-02-13 18:23:21 UTC
Works fine for me

ls -lrt folders-only/
total 8
drwxr-xr-x 2 tsdgeos tsdgeos 4096 Feb  5 14:58 has-files
drwxr-xr-x 2 tsdgeos tsdgeos 4096 Feb  5 14:58 empty
Comment 4 Bug Janitor Service 2022-02-13 18:27:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/ark/-/merge_requests/100
Comment 5 Albert Astals Cid 2022-02-13 18:27:25 UTC
(In reply to Albert Astals Cid from comment #3)
> Works fine for me
> 
> ls -lrt folders-only/
> total 8
> drwxr-xr-x 2 tsdgeos tsdgeos 4096 Feb  5 14:58 has-files
> drwxr-xr-x 2 tsdgeos tsdgeos 4096 Feb  5 14:58 empty

Ignore me i didn't realize it was about access time
Comment 6 Patrick Silva 2022-02-14 01:00:30 UTC
duplicate of bug 424740
Comment 7 Albert Astals Cid 2022-02-14 10:01:42 UTC
Let's duplicate it the other way around given how the fix i prepared refers to this bug number and not the other one.
Comment 8 Albert Astals Cid 2022-02-14 10:02:14 UTC
*** Bug 424740 has been marked as a duplicate of this bug. ***
Comment 9 Albert Astals Cid 2022-02-21 13:20:13 UTC
Git commit 229b9ce8372014469443de93a193c584e3936509 by Albert Astals Cid.
Committed on 13/02/2022 at 18:26.
Pushed by aacid into branch 'release/21.12'.

zip: Fix setting un-initialized access time

M  +3    -1    plugins/libzipplugin/libzipplugin.cpp

https://invent.kde.org/utilities/ark/commit/229b9ce8372014469443de93a193c584e3936509