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

Bug #2062968 reported by ivanmara
120
This bug affects 22 people
Affects Status Importance Assigned to Milestone
Midnight Commander
Fix Released
Unknown
mc (Ubuntu)
Fix Released
Undecided
Unassigned
Noble
Fix Released
Undecided
Unassigned
Oracular
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

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)

[ Test Plan ]

Navigate to an archive, press ENTER, verify archive is opened and content is displayed properly.

[ Where Problems Could Occur ]

The patch modifies the config file mc.ext.in so theoretically other config settings might get messed up, if the patch is incorrect.

[ Other Info ]

Patch is pulled from here: https://salsa.debian.org/debian/mc/-/commit/daeabd910de6868140272e365f755d207a986e39

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
Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Fixed in master.

Revision history for this message
gna (nagy-gergely) wrote :

the most problemsolving workaround is/was:
```
sudo sed '/Regex=/s/\\/\\\\/g' -i /etc/mc/mc.ext.ini
```

Revision history for this message
Roman Valov (reddot) wrote :

Is there any movement to get the fix into SRU process?

Revision history for this message
Mai Thế Chuyền (chuyenmt) wrote :

I have 1 archives (A.zip) with large zip file (370 file in here, each is 20char length filename).

I cannot opening/navigating archives by enter with large files.

But archives file with 30 file was can navigating.

```
mc --version
GNU Midnight Commander 4.8.31
Built with GLib 2.72.1
Built with S-Lang 2.3.2 with terminfo database
Built with libssh2 1.10.0
With builtin Editor
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
With ext2fs attributes 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;

```

My Ubuntu:

```
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
```

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

This seems to be a different issue, if you can enter the archives at all, and extension case / output of `file` utility is the same for both "good" and "bad" archive.

Unfortunately, it's impossible for us to do anything about it with the information you provided. Best would be to be able to reproduce the problem.

Maybe you can check whether this is a problem with mc in the first place. If zip command line utility cannot list the archive, then the problem is elsewhere. If it can, you can try to see if the zip command started by mc hangs in the background, if mc hangs when entering "bad" archive.

Revision history for this message
Juerg Haefliger (juergh) wrote :
description: updated
Revision history for this message
Juerg Haefliger (juergh) wrote :

Source and binaries with the above debdiff applied: https://launchpad.net/~juergh/+archive/ubuntu/mc

Changed in mc (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Juerg Haefliger (juergh)
Changed in mc (Ubuntu Noble):
status: New → In Progress
assignee: nobody → Juerg Haefliger (juergh)
Changed in mc (Ubuntu):
status: In Progress → Fix Released
assignee: Juerg Haefliger (juergh) → nobody
Revision history for this message
Yury V. Zaytsev (zyv) wrote :

If you want to backport instead of upgrading consider taking this important fix as well:

https://github.com/MidnightCommander/mc/commit/942869713448691f377b91f26cf9ebdac9e2e4c9

What Debian picked is unfortunately only a partial fix.

Revision history for this message
Juerg Haefliger (juergh) wrote :

Ah thanks for that! Will pull it in as well.

Revision history for this message
Juerg Haefliger (juergh) wrote :

Updated debdiff attached. Includes 4 new patches from upstream https://github.com/MidnightCommander/mc.
Source and binary packages: https://launchpad.net/~juergh/+archive/ubuntu/mc

Juerg Haefliger (juergh)
Changed in mc (Ubuntu Noble):
assignee: Juerg Haefliger (juergh) → nobody
Juerg Haefliger (juergh)
Changed in mc (Ubuntu Noble):
status: In Progress → Confirmed
Revision history for this message
Adam Vodopjan (grozzly) wrote :

I see, this bug is still not fixed in 24.04. Here is a temp solution for all problems mentioned above:

sed -E '/^Type=/s/\\ / /g;/^(Type|Regex)=/s/\\/\\\\/g' mc.ext.ini > mc.ext.ini-fixed

You can do it for /etc/mc/mc.ext.ini OR your per-user ~/.config/mc/mc.ext.ini (the latter shadows the former btw). Next, replace the original file with a fixed one and be sure to restart mc to apply the changes.

Revision history for this message
Juerg Haefliger (juergh) wrote :

Yeah, still waiting for ubuntu-sponsors :-(

Revision history for this message
Simon Chopin (schopin) wrote :

Hi Juerg,

While your debdiff is OK for a devel upload (with some improvements possible ;-) ), SRUs are a slightly different beast, and I've seen uploads rejected for some of the reasons outlined below.

The first and most important thing is that changes should be as minimal as possible. Here, that means the 4th patch should be dropped as it is unrelated to the actual bug and only creates noise.

Second, the version number should probably be 4.8.30-1ubuntu0.1 rather than ...ubuntu1. While in this particular case it wouldn't be a problem since Oracular shipped with a new version, it's a good habit to take.

Third, the patches could use some DEP-3 love: https://dep-team.pages.debian.net/deps/dep3/
I find the Origin, Forwarded and Applied-Upstream particularly helpful for ongoing maintenance.

And finally, the changelog could maybe be a bit verbose?

Revision history for this message
Juerg Haefliger (juergh) wrote :

Updated debdiff that should address all review comments.

Revision history for this message
Juerg Haefliger (juergh) wrote (last edit ):

Oracular is partially affected. It can't handle .mo files.

Revision history for this message
Juerg Haefliger (juergh) wrote :

debdiff for Oracular.

Revision history for this message
Simon Quigley (tsimonq2) wrote :

I'm really curious why this is marked as Fix Released for Plucky given it's identical to the version in Oracular.

Anyway, uploading to all three releases. Thank you!

Changed in mc (Ubuntu):
status: Fix Released → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mc - 3:4.8.31-1ubuntu1

---------------
mc (3:4.8.31-1ubuntu1) plucky; urgency=medium

  * Fixes: mc not opening/navigating archives when pressing ENTER (LP: #2062968)

 -- Juerg Haefliger <email address hidden> Thu, 12 Dec 2024 07:04:07 +0100

Changed in mc (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Yury V. Zaytsev (zyv) wrote :

> I'm really curious why this is marked as Fix Released for Plucky given it's identical to the version
> in Oracular.

I think that this might have happened because part of the patterns were fixed, and later it was discovered that the fix is not complete, but the status was not properly reset.

> Anyway, uploading to all three releases. Thank you!

Thanks for uploading, I hope that we are going to get less reports about this issue in the future. Most users go directly upstream, don't search and open a new ticket :(

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mc (Ubuntu Oracular):
status: New → Confirmed
Revision history for this message
Maxim Akristiniy (amv007) wrote :

> sed -E '/^Type=/s/\\ / /g;/^(Type|Regex)=/s/\\/\\\\/g' mc.ext.ini > mc.ext.ini-fixed
Thank you Adam, all working.

may be simplest way for fix:
sudo sed -i '/^Type=/s/\\ / /g;/^(Type|Regex)=/s/\\/\\\\/g' /etc/mc/mc.ext.ini

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello ivanmara, or anyone else affected,

Accepted mc into oracular-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mc/3:4.8.31-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-oracular to verification-done-oracular. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-oracular. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in mc (Ubuntu Oracular):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-oracular
Changed in mc (Ubuntu Noble):
status: Confirmed → Fix Committed
tags: added: verification-needed-noble
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello ivanmara, or anyone else affected,

Accepted mc into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mc/3:4.8.30-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (mc/3:4.8.31-1ubuntu0.1)

All autopkgtests for the newly accepted mc (3:4.8.31-1ubuntu0.1) for oracular have finished running.
The following regressions have been reported in tests triggered by the package:

forensics-extra/2.54 (amd64)
forensics-extra/unknown (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/oracular/update_excuses.html#mc

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Juerg Haefliger (juergh) wrote :

Installed mc/4.8.31-1ubuntu0.1 from oracular-proposed and verified that archives (xz,mo,deb) can be opened.

tags: added: verification-done-oracular
removed: verification-needed-oracular
Revision history for this message
Juerg Haefliger (juergh) wrote :

Installed mc/4.8.30-1ubuntu0.1 from noble-proposed and verified that archives (xz,mo,deb) can be opened.

tags: added: verification-done-noble
removed: verification-needed-noble
Revision history for this message
Valentyna (valia0906) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mc - 3:4.8.31-1ubuntu0.1

---------------
mc (3:4.8.31-1ubuntu0.1) oracular; urgency=medium

  * Fixes: mc not opening/navigating archives when pressing ENTER (LP: #2062968)

 -- Juerg Haefliger <email address hidden> Thu, 12 Dec 2024 07:04:07 +0100

Changed in mc (Ubuntu Oracular):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for mc has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mc - 3:4.8.30-1ubuntu0.1

---------------
mc (3:4.8.30-1ubuntu0.1) noble; urgency=medium

  * Fixes: mc not opening/navigating archives when pressing ENTER (LP: #2062968)

 -- Juerg Haefliger <email address hidden> Wed, 11 Dec 2024 15:41:41 +0100

Changed in mc (Ubuntu Noble):
status: Fix Committed → 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.