LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   [current]mc doesn't open archives with non standard extension (https://www.linuxquestions.org/questions/slackware-14/%5Bcurrent%5Dmc-doesnt-open-archives-with-non-standard-extension-4175697528/)

aianson 07-09-2021 10:05 PM

[current]mc doesn't open archives with non standard extension
 
mc isn't opening archives with a non standard extension.

I just noticed this recently, in the last year or so and I am not sure what the issue is so I'm not sure where to start looking.

In my own case I am working with zip files with a non standard extension like .fr0 or .sa1. I was always able to open those files with mc and read or copy the files within those archives.

Can anyone shed some light on this and point me toward a solution?

elcore 07-10-2021 01:16 AM

Never really tested this before, but are you sure it was not a custom function for fr0 and sa1 listed in your /etc/mc/mc.ext file?
AFAIK, that is where zip extension is specified, for mc to be able to read a zip file.

aianson 07-10-2021 03:21 AM

Quote:

Originally Posted by elcore (Post 6265438)
Never really tested this before, but are you sure it was not a custom function for fr0 and sa1 listed in your /etc/mc/mc.ext file?
AFAIK, that is where zip extension is specified, for mc to be able to read a zip file.

Not that I am aware of. I have never customized any of the files in /etc/mc.

This does work on 14.2 but not -current and I am not sure what the difference is.

elcore 07-10-2021 03:33 AM

Might've been changed in mc code upstream, I can't make it open zip.fr0 on mc-4.8.26 either.

Edit: Nevermind, according to changelog, it's highly likely that this has caused it:

Code:

Version 4.8.12

- VFS
    * Use .zip extension as preferred way to recognize ZIP archives (#2857)


aianson 07-10-2021 06:35 AM

Quote:

Originally Posted by elcore (Post 6265452)
Might've been changed in mc code upstream, I can't make it open zip.fr0 on mc-4.8.26 either.

Edit: Nevermind, according to changelog, it's highly likely that this has caused it:

Code:

Version 4.8.12

- VFS
    * Use .zip extension as preferred way to recognize ZIP archives (#2857)


I don't think that is it. On a vps running mc 4.8.22 I can also open zip files with a non standard extension.

elcore 07-10-2021 07:40 AM

Quote:

Originally Posted by aianson (Post 6265472)
I don't think that is it. On a vps running mc 4.8.22 I can also open zip files with a non standard extension.

Compiled 4.8.22 on slackware64-14.2 and this is correct. 4.8.22 still reads zip files regardless of extension, while 4.8.24 does not.
Probably best to report it upstream, doesn't seem like packaging issue.

shruggy 07-10-2021 08:18 AM

There's an easy workaround.
Code:

sed -i 's|^\(type/\)i/^zip\\|\1\\(Zip|' /etc/mc/mc.ext
See ticket #4180. The regression was introduced with this commit that added the -z switch to the file command invoked on type/ lines in mc.ext. It was partly fixed upstream in this commit, and then definitely, by this commit.

This may still be not enough on Slackware-current if file there is linked with libseccomp (it isn't on Debian, but Slackware rarely changes upstream defaults). mc would also need this patch then.

aianson 07-10-2021 07:06 PM

[SOLVED] [current]mc doesn't open archives with non standard extension
 
Quote:

Originally Posted by shruggy (Post 6265492)
There's an easy workaround.
Code:

sed -i 's|^\(type/\)i/^zip\\|\1\\(Zip|' /etc/mc/mc.ext
See ticket #4180. The regression was introduced with this commit that added the -z switch to the file command invoked on type/ lines in mc.ext. It was partly fixed upstream in this commit, and then definitely, by this commit.

This may still be not enough on Slackware-current if file there is linked with libseccomp (it isn't on Debian, but Slackware rarely changes upstream defaults). mc would also need this patch then.

Thank you. The sed command you gave solves this for me on slackware-current.

elcore 08-15-2021 01:22 PM

It appears that it's fixed upstream in 4.8.27

marav 08-15-2021 02:31 PM

Quote:

Originally Posted by elcore (Post 6275467)
It appears that it's fixed upstream in 4.8.27

right

http://midnight-commander.org/wiki/NEWS-4.8.27


All times are GMT -5. The time now is 07:39 PM.