Skip to content
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

Adding an executable file to a zip archive with F5 forgets the executable bit #4628

Closed
mc-butler opened this issue Jan 9, 2025 · 8 comments
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.8.32 Reproducible in version 4.8.32

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4628
Reporter ilyagr (mc@….ilya.gr)
  1. Open a ZIP archive by pressing Enter on it in the left pane. In my case, the file had VSIX extension (don't think it matters)
  2. Find an executable file (in the Unix sense) on the right pane
  3. Press F5 and Enter to copy the file into the archive.
  4. Observe that the executable bit is not set.

zipinfo confirms that the executable bit is not set. In this example zipinfo file, the last three files were added by MC, the rest were there before.

$ zipinfo test.vsix
Archive:  test.vsix
Zip file size: 52810887 bytes, number of entries: 49
(... some files omitted)
-rw-rw-r--  6.3 unx     3156 b- defN 24-Dec-29 15:49 extension.vsixmanifest
-rw-------  3.0 unx 34599192 bx defN 25-Jan-08 17:52 extension/_dist/superbol-free2
-rw-------  3.0 unx 34599192 bx defN 25-Jan-08 18:08 extension/_dist/superbol-free3
-rw-------  3.0 unx 34599192 bx defN 25-Jan-08 18:08 extension/_dist/superbol-free-linux-x64
49 files, 128163558 bytes uncompressed, 52802923 bytes compressed:  58.8%

The expected output would be something like:

...
-rw-r--r--  6.3 unx     2044 bl defN 24-Dec-29 15:29 extension/syntaxes/listfile.tmLanguage.json
-rw-rw-r--  6.3 unx     3156 b- defN 24-Dec-29 15:49 extension.vsixmanifest
-r-xr-xr-x  6.3 unx 34599192 bx defN 24-Dec-29 15:49 extension/_dist/superbol-free
...

mc -V returns:

GNU Midnight Commander 4.8.32
Built with GLib 2.82.4
Built with S-Lang 2.3.3 with terminfo database
Built with libssh2 1.11.1
With builtin editor
With subshell support as default
With support for background operations
With mouse support on xterm
With support for X11 events
With internationalization support
With multiple codepages support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, shell
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;

I'm running on darwin-aarch64

@mc-butler
Copy link
Author

Changed by ilyagr (mc@….ilya.gr) on Jan 9, 2025 at 2:25 UTC (comment 1)

  • Version changed from master to 4.8.32

See also #4629 for a followup.

@mc-butler
Copy link
Author

Changed by ilyagr (mc@….ilya.gr) on Jan 9, 2025 at 2:47 UTC (comment 2)

Oh, and in case something is weird about my ZIP/VSIX file, you can download it from https://drive.google.com/file/d/1FHWgpjqmb_uhk65gbKp7tvZLCcYuq61B/view?usp=drive_link .

It contains an executable file in extension/_dist subdirectory. My original goal was to rename it via MC, so I tried extracting, renaming, and re-adding it. However, it lost the executable bit upon being re-added.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 9, 2025 at 5:46 UTC (comment 3)

Apparently, the duplicate of #4558.

@mc-butler
Copy link
Author

Changed by ilyagr (mc@….ilya.gr) on Jan 9, 2025 at 6:09 UTC (comment 4)

The end-result is similar, but I am not sure whether or not they are duplicates. For #4558, I'm not sure the 7zip format supports Unix-style executable bits at all. Zip format definitely does. I'm also not sure whether mc uses the same library to modify zip and 7zip archives.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jan 9, 2025 at 10:28 UTC (comment 5)

  • Resolution set to duplicate
  • Status changed from new to closed

Closed as duplicate of #4558.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jan 9, 2025 at 10:30 UTC (comment 6)

I also think that this is a duplicate of #4558. Let's continue the discussion there. I think that #4629 is a separate issue, so we can leave it open.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Jan 10, 2025 at 16:31 UTC (comment 7)

  • Milestone Future Releases deleted

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 10, 2025 at 17:00 UTC (comment 8)

  • Component changed from mc-core to mc-vfs
  • Description edited

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: vfs Virtual File System support prio: medium Has the potential to affect progress ver: 4.8.32 Reproducible in version 4.8.32
Development

No branches or pull requests

1 participant