The error message is:
{{{
Cannot open "/path/to/ff_ext.xpi" in parse mode
No such file or directory (2)
}}}
If I renaming {{{ .xpi }}} archive to {{{ .zip }}}, mc display the content
just fine:
{{{
$ file ff_ext.xpi
ff_ext.xpi: Zip archive data, at least v1.0 to extract
$ cp ff_ext.xpi ff_ext.zip
$ file ff_ext.zip
ff_ext.zip: Zip archive data, at least v1.0 to extract
}}}
F3 on {{{ ff_ext.zip }}} display list of files in the archive.
However:
{{{
$ zip archive some-dummy-file.txt
adding: some-dummy-file.txt (deflated 66%)
$ file archive.zip
archive.zip: Zip archive data, at least v2.0 to extract
}}}
F3 on {{{ archive.zip }}} display list of files in the archive.
{{{
$ cp archive.zip archive.xpi
}}}
F3 on {{{ archive.xpi }}} and mc display the content of {{{ some-dummy-
file.txt }}} instead of archive filename list.
{{{
$ zip archive1 some-dummy-file.txt another-dummy-file.txt
adding: some-dummy-file.txt (deflated 66%)
adding: another-dummy-file.txt (deflated 66%)
$ file archive1.zip
archive1.zip: Zip archive data, at least v2.0 to extract
$ cp archive1.zip archive1.xpi
}}}
F3 on {{{ archive1.xpi }}} and the same message is shown:
{{{
Cannot open "/path/to/archive1.xpi" in parse mode
No such file or directory (2)
}}}
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180>
Midnight Commander <https://midnight-commander.org>
Midnight Development Center
* owner: => andrew_b
* cc: ossi (added)
* status: new => accepted
* component: mc-vfs => mc-core
* branch_state: no branch => on review
Comment:
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:
{{{
#!diff
--- 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
changeset:7881ed2fda7390d3821abd6864d0097fc818f0ac
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:1>
Comment (by gv):
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.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:2>
Comment (by andrew_b):
Sorry, I cannot reproduce that. Please check your files again.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:3>
Comment (by gv):
I did not quit mc after I changed mc.ext. It works fine now.
Thank you.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:4>
Comment (by andrew_b):
Ticket #4183 has been marked as a duplicate of this ticket.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:5>
* votes: => gv andrew_b
* branch_state: on review => approved
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:6>
* status: accepted => testing
* votes: gv andrew_b => committed-master
* resolution: => fixed
* branch_state: approved => merged
Comment:
Merged to master: [a75071b3c07d7dc2795ad2c321e1e340eceadb24].
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:7>
* status: testing => closed
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:8>
* status: closed => reopened
* resolution: fixed =>
Comment:
After applying the patch, zip archives began to open, but open with an
error:
{{{
file -L -z archive.zip: Bad system call
}}}
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.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:9>
* cc: jg.staffel@… (added)
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:10>
Comment (by ossi):
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.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:11>
Comment (by alpir):
Gentoo x64,sys-apps/file-5.39-r3 has default USE flag seccomp. As far as I
know, file is also built with this option in Arch.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:12>
* cc: onlyjob@… (added)
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:13>
* votes: committed-master =>
* version: 4.8.26 => master
* branch_state: merged => on review
Comment:
Branch: 4180_file_S
changeset:e43c9e6431fe21110097a63cd3f1fd1b35e6353e
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:14>
Comment (by ossi):
i'd swap the use order of FILE_L and FILE_S, as -S is related to -z.
also, the else-branches in the AC_DEFINEs should use empty strings, not
spaces.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:15>
Comment (by ossi):
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).
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:16>
Comment (by andrew_b):
[ec1938db8ef8171440e1a56aea94feec59d23f71]
If `file` doesn't accept the `-z` options, it unused at all.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:17>
Comment (by ossi):
not reviewed in context and not tested, but what i see looks good.
fwiw, there is an excess space on line 134 after the comma.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:18>
Comment (by andrew_b):
Ticket #4208 has been marked as a duplicate of this ticket.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:19>
* votes: => andrew_b
* branch_state: on review => approved
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:20>
* status: reopened => closed
* votes: andrew_b => committed-master
* resolution: => fixed
* branch_state: approved => merged
Comment:
Merged to master: [c9cf22d458709dad97cd2b6cacd61db66178e381].
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:21>
Comment (by sorin):
I am wondering if that is the same bug which prevents browsing of python
wheels (.whl) on my macos box.
$ file some.whl
some.whl: Zip archive data, at least v2.0 to extract
$ file -L -z some.whl
some.whl: ERROR:[gzip: Unknown compression format] (Zip archive data, at
least v2.0 to extract)
Sadly, even after compiling and installing the head version, it appears
that mc is unable to browse zip or whl archives.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:27>
Comment (by andrew_b):
You should sync your user's mc.ext with system-wide one.
Currently, I'm using 4.8.26-214-ga81f1ca19. It works fine:
{{{
$ file -L Django-1.8.4-py2.py3-none-any.whl
Django-1.8.4-py2.py3-none-any.whl: Zip archive data, at least v2.0 to
extract
$ file -L -z Django-1.8.4-py2.py3-none-any.whl
Django-1.8.4-py2.py3-none-any.whl: ASCII Java program text (Zip archive
data, at least v2.0 to extract)
$ /usr/lib/mc/extfs.d/uzip list Django-1.8.4-py2.py3-none-any.whl | head
-n 10
-rwxrwxr-x 1 500 500 115 08/18/2015 12:55:12
./Django-1.8.4.data/scripts/django-admin.py
-rw-rw-r-- 1 500 500 10 08/18/2015 12:55:14
./Django-1.8.4.dist-info/DESCRIPTION.rst
-rw-rw-r-- 1 500 500 1552 08/18/2015 12:55:14
./Django-1.8.4.dist-info/LICENSE.txt
-rw-rw-r-- 1 500 500 83 08/18/2015 12:55:12
./Django-1.8.4.dist-info/entry_points.txt
-rw-rw-r-- 1 500 500 1594 08/18/2015 12:55:14
./Django-1.8.4.dist-info/metadata.json
-rw-rw-r-- 1 500 500 7 08/18/2015 12:55:12
./Django-1.8.4.dist-info/top_level.txt
-rw-rw-r-- 1 500 500 110 08/18/2015 12:55:14
./Django-1.8.4.dist-info/WHEEL
-rw-rw-r-- 1 500 500 1300 08/18/2015 12:55:14
./Django-1.8.4.dist-info/METADATA
-rw-rw-r-- 1 500 500 327077 08/18/2015 12:55:14
./Django-1.8.4.dist-info/RECORD
-rw-rw-r-- 1 500 500 519 08/18/2015 12:54:50
./django/__init__.py
}}}
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:28>
Comment (by andrew_b):
Replying to [comment:29 teras]:
> Any clues?
Probably #4502.
--
Ticket URL: <http://www.midnight-commander.org/ticket/4180#comment:30>