Ticket #4090 (closed defect: invalid)
Zip extraction: executable attribute lost
Reported by: | mlg3 | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | mc-vfs | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
When we use the Midnight Commander to unpack a zip archive, the executable files become non-executable. Having to do chmod manually is annoying, especially when we unpack a software distribution.
When we use the Midnight Commander to examine a zip archive, the executable files are shown as non-executable. This is very misleading.
WHY THIS BUG IS IMPORTANT
People consider mc as a good replacement for the command-line utilities that work with zip files. This bug means that mc does not display and unpack zipped software distributions correctly. If you unpack a software distribution with mc, you will have to fix executable files that lost the executable attribute.
STEPS TO REPRODUCE
STEP 1
Create two files (one executable and one not executable), and a zip archive with them.
me@comp:~/fsf/x/y$ echo "echo first">first me@comp:~/fsf/x/y$ echo "echo second">second me@comp:~/fsf/x/y$ chmod a+x first me@comp:~/fsf/x/y$ ./first first me@comp:~/fsf/x/y$ ./second bash: ./second: Permission denied me@comp:~/fsf/x/y$ zip both * adding: first (stored 0%) adding: second (stored 0%) me@comp:~/fsf/x/y$ mkdir u; cd u me@comp:~/fsf/x/y/u$ unzip ../both.zip Archive: ../both.zip extracting: first extracting: second me@comp:~/fsf/x/y/u$ ls -l total 8 -rwxrwxr-x 1 me me 11 jun 5 19:40 first -rw-rw-r-- 1 me me 12 jun 5 19:40 second me@comp:~/fsf/x/y/u$ ./first first me@comp:~/fsf/x/y/u$ ./second bash: ./second: Permission denied me@comp:~/fsf/x/y/u$
STEP 2
Launch mc in the directory that contains the files first, second, and both.zip (~/fsf/x/y/ above)
As expected, due to coloring you will see that first is executable while second is not.
STEP 3
In mc, enter the archive both.zip
Expected: first is colored like executable, second as ordinary (not executable)
Actual: both first and second are colored as ordinary (not executable)
STEP 4
In mc, create the directory w (~/fsf/x/y/w) and copy both files there
Expected: first is executable, second is ordinary (not executable)
Actual: both first and second are not executable
me@comp:~/fsf/x/y/w$ ./first bash: ./first: Permission denied me@comp:~/fsf/x/y/w$ ./second bash: ./second: Permission denied me@comp:~/fsf/x/y/w$
Version info:
This is the mc that comes with the latest LTS Ubuntu:
me@comp:~$ mc --version GNU Midnight Commander 4.8.24 Built with GLib 2.63.3 Using the S-Lang library with terminfo database With builtin Editor and Aspell support With subshell support as default With support for background operations With mouse support on xterm and Linux console With support for X11 events With internationalization support With multiple codepages support Virtual File Systems: cpiofs, tarfs, sfs, extfs, ext2undelfs, ftpfs, sftpfs, fish Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64; me@comp:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal me@comp:~$
Change History
comment:2 in reply to: ↑ description Changed 5 years ago by andrew_b
- Status changed from new to closed
- Resolution set to invalid
Replying to mlg3:
STEP 3
In mc, enter the archive both.zip
Expected: first is colored like executable, second as ordinary (not executable)
Actual: both first and second are colored as ordinary (not executable)
mc uses unzip in zipinfo mode to restore file permissions.
Ask your mc maintainer to to add zipinfo dependency to mc package.
Hint: https://github.com/MidnightCommander/mc/blob/master/src/vfs/extfs/helpers/uzip.in#L22