-
Notifications
You must be signed in to change notification settings - Fork 4
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
mc 4.8.26: cannot view content of .xpi archives (firefox extensions, aka zip files with .xpi extension) #4180
Comments
This is the result of #4128. You should synchronize your local ~/.config/mc/mc.ext with system-wide /etc/mc/mc.ext.
As a quick workaround, you can change one line in your mc.ext: --- mc.ext.orig 2021-01-23 20:57:27.000000000 +0300
+++ mc.ext 2021-01-23 20:58:30.000000000 +0300
@@ -751,7 +751,7 @@
View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view zip
# zip
-type/i/^zip\ archive
+type/\(Zip archive
Open=%cd %p/uzip://
View=%view{ascii} /usr/libexec/mc/ext.d/archive.sh view zip
Branch: 4180_mc.ext_zip_regex |
Sorry, but there is no mc.ext in ~/.config/mc. Instead I changed /etc/mc/mc.ext.
Still, I get the same error message. After the dialog is dismissed, mc show the raw content of the archive (the same you get with Shift-F3) instead of the list of files in the archive. Pressing enter on the xpi file does nothing. |
Sorry, I cannot reproduce that. Please check your files again. |
I did not quit mc after I changed mc.ext. It works fine now.
Thank you. |
|
|
After applying the patch, zip archives began to open, but open with an error:
This caused by using /usr/bin/file with -z option (src/filemanager/ext.c), because seccomp doesn't allow it. The problem is seccomp, a security sandbox. Security is more important than usability, so if we actually need -z, we should generally also use -S. |
|
my manual contains this nice blurb:
Note: This Debian version of file was built without seccomp support, so this option has no effect.
which is why i never noticed that this option was introduced at some point.
i'll note that a sandbox that cripples the host program is somewhat "sub-par". a proper implementation would use a non-sandboxed helper process for spawning essential children (which would ideally run inside a sandbox in turn).
i suppose adding -S is the way forward. |
Gentoo x64,sys-apps/file-5.39-[3] has default USE flag seccomp. As far as I know, file is also built with this option in Arch. |
|
Branch: 4180_file_S |
i'd swap the use order of FILE_L and FILE_S, as -S is related to -z. |
on a mildly related note, it would probably make sense to also check for -z, and just error out if that fails (as implementing an alternative path for that seems kinda impractical). |
[ec1938db8ef8171440e1a56aea94feec59d23f71]
If file doesn't accept the -z options, it unused at all. |
not reviewed in context and not tested, but what i see looks good. |
|
It's still not 100% fixed.
Since in file mc.ext
is evaluated before
mc assume image.zip is a image not an archive. |
Works fine. Thank you. |
|
I am wondering if that is the same bug which prevents browsing of python wheels (.whl) on my macos box.
$ file some.whl
$ file -L -z some.whl
Sadly, even after compiling and installing the head version, it appears that mc is unable to browse zip or whl archives. |
You should sync your user's mc.ext with system-wide one.
Currently, I'm using 4.8.26-214-ga81f1ca19. It works fine:
|
Sorry to revive an old thread, but it seems that JAR files are (once more?) not recognized by mc. I don't have a ~/.config/mc/mc.ext.ini file, and the syntax of this file seems different than the one shown here. As usual, I can browse a regular ZIP file; the problem is with JAR files. Any clues? |
Important
This issue was migrated from Trac:
gv
(gabriel@….net)ossi
(@ossilator),jg.staffel@….com
,onlyjob@….fsf.org
(@onlyjob)Up to mc 4.8.25 you can view the content of firefox extensions (.xpi files). This is not possible anymore.
The error message is:
If I renaming .xpi archive to .zip , mc display the content just fine:
F3 on ff_ext.zip display list of files in the archive.
However:
F3 on archive.zip display list of files in the archive.
F3 on archive.xpi and mc display the content of some-dummy-file.txt instead of archive filename list.
F3 on archive1.xpi and the same message is shown:
The text was updated successfully, but these errors were encountered: