mc (Midnight commander) not opening/navigating archives by enter

Bug #2062968 reported by ivanmara
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Midnight Commander
Fix Released
Unknown
mc (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

In ubuntu 24.04 mc (Midnight commander) not opening/navigating archives by enter.

Probably need update to 4.8.31 version according to this post: https://github.com/orgs/Homebrew/discussions/3467#discussioncomment-8265535

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: mc 3:4.8.30-1build2
ProcVersionSignature: Ubuntu 6.8.0-28.28-generic 6.8.1
Uname: Linux 6.8.0-28-generic x86_64
ApportVersion: 2.28.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Apr 20 16:38:56 2024
InstallationDate: Installed on 2024-04-19 (1 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Beta amd64 (20240418)
ProcEnviron:
 LANG=ru_RU.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: mc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
ivanmara (aesthete2005) wrote :
Yury V. Zaytsev (zyv)
Changed in mc (Ubuntu):
status: New → Confirmed
Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Unfortunately, Dmitry has just committed the patch, but hasn't pushed a new build:

https://salsa.debian.org/debian/mc/-/commit/daeabd910de6868140272e365f755d207a986e39

... or upgraded the package to 4.8.31.

I have no upload rights in Ubuntu, but it would be nice if someone who has could just take this commit specifically into 24.04, because it's going to be an LTS and otherwise a pretty major part of the functionality is going to be broken for years.

It's totally safe and a lot less work than upgrading the package...

Revision history for this message
Dmitry A. Koptev (dimez) wrote :

Please update mc to new version.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Can you maybe get in touch with MOTUs? No idea, what's the right way - mailing list, IRC. Unfortunately, I find it highly doubtful that anyone who can actually upload is reading bug mail for this package.

Revision history for this message
ivanmara (aesthete2005) wrote (last edit ):

Is there a workaround for this problem?

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Yes, you can try to use our mc.ext instead of what comes with the package:

https://github.com/MidnightCommander/mc/blob/master/misc/mc.ext.ini.in

In mc menu select 'Command' -> 'Edit extension file', replace the text, save and exit the editor to notify mc of your changes.

Revision history for this message
ivanmara (aesthete2005) wrote :
Revision history for this message
Zoltán Kovács (kovzol-geogebra) wrote (last edit ):

By using the fast workaround, archives can be opened and navigation is possible via Enter, but other files do not start (e.g. .docx, .png), I get the following error:

/tmp/mc-kovzol/mcext0NQTN2: 13: @EXTHELPERSDIR@/doc.sh: not found
/tmp/mc-kovzol/mcextF4QZN2: 13: @EXTHELPERSDIR@/image.sh: not found

Should I substitute @EXTHELPERSDIR@ by something in the .ini file? --- Yes, it turned out that a substitution by /usr/lib/mc/ext.d solves the issue.

Revision history for this message
Artyom Gharibyan (artem-sofs) wrote :

In ubuntu 24.04 war archives not open via enter. I updated 4.8.30 to 4.8.31, but after hitting enter not opening war files.

Revision history for this message
Artyom Gharibyan (artem-sofs) wrote (last edit ):

In video you can see that war archives not opening via mc 4.8.31 , ubuntu 24.04

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

So can you finally show the output of `file` and see if this is now different / doesn't match mc.ext pattern?

Revision history for this message
Artyom Gharibyan (artem-sofs) wrote (last edit ):

:~/releases# file web.hospital.war
web.hospital.war: Java archive data (JAR)

Now I have installed mc 4.8.30, and I do
sudo wget https://raw.githubusercontent.com/MidnightCommander/mc/master/misc/mc.ext.ini.in -O /etc/mc/mc.ext.ini

but still nor response

when I hit enter no response and no output on terminal

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

The latest version is 4.8.31, there overwriting of mc.ext should not be necessary. If you do overwrite it, then you also have to do the replacements above.

The pattern says

```
Type=\(Java\ (Jar\ file|archive)\ data\ \((zip|JAR)\)
```

which should match

```
Java archive data (JAR)
```

so nothing has changed here.

I have no idea what's going on your system. Maybe you have a user mc.ext? Did you try on a fresh user? Does entering into ZIP archives work? What if you rename your war to zip? What if you rename a real zip to test?

Revision history for this message
Artyom Gharibyan (artem-sofs) wrote (last edit ):

Dear Yury,
When I change war to zip, all working good. And I can enter into archive and do my work.

But no response for war extension

At this moment I installed 4.8.30, and do sudo wget https://raw.githubusercontent.com/MidnightCommander/mc/master/misc/mc.ext.ini.in -O /etc/mc/mc.ext.ini

I have /etc/mc/mc.ext.ini file

[jar]
Type=\(Java\ (Jar\ file|archive)\ data\ \((zip|JAR)\)
TypeIgnoreCase=true
Open=%cd %p/uzip://
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view zip

Is this ok?

I am using ubuntu 24.04LTS

the problem exists with normal user and with root user

Revision history for this message
Artyom Gharibyan (artem-sofs) wrote :

Dear Yury,
I added following to /etc/mc/mc.ext.ini file and mc started recognize .war files

[war-by-shell]
Shell=.war
ShellIgnoreCase=true
Open=%cd %p/uzip://
View=%view{ascii} @EXTHELPERSDIR@/archive.sh view zip

Thanks a lot.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Detection by type is broken due to wrong escaping. Reopened upstream. Thanks for reporting.

Changed in mc:
status: Unknown → New
Revision history for this message
Michael Heča (orgoj) wrote :

Escaping fix from arch linnux is working https://bbs.archlinux.org/viewtopic.php?pid=2119187#p2119187

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

This is already in master, but there are now things that are escaped, which shouldn't be escaped. Also, archives now work, affected are complicated type-based patterns.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :
Changed in mc:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.