Ticket #4419 (closed defect: fixed)

Opened 6 months ago

Last modified 5 months ago

Zip archives with files having phrase `makefile' in name treat them as makefiles

Reported by: cieply Owned by: andrew_b
Priority: major Milestone: 4.8.29
Component: mc-core Version: 4.8.28
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

I found this issue recently.
Zip archives with files having phrase `makefile' in name treat them as makefiles and upon enter mc tries to read paramaters for makefile and execute it.
I attached few samples.
Just try to enter/view them and you will see.

Even worse it is with compressed pdfs. They don't even need to use `.pdf' extension, they will be picked up anyway. Trying to view zipped pdf ends up with error window "Syntax Warning: May not be a PDF file (continuing anyway)" and one cannot view nor enter it. All one can do is to manually unzip it end then it can be read.
Example:

wget https://sun.aei.polsl.pl/~sdeor/corpus/reymont.bz2
bzip2 -dk reymont.bz2
zip reymont.zip reymont

These shouldn't work like that. One should be able to enter to zip archive and view it if they want, not to be treated like scripts.

Attachments

zipped_makefiles.zip (2.7 KB) - added by cieply 6 months ago.

Change History

Changed 6 months ago by cieply

comment:1 Changed 6 months ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Component changed from mc-vfs to mc-core

comment:2 Changed 6 months ago by andrew_b

comment:3 Changed 6 months ago by andrew_b

  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.29

comment:4 follow-up: ↓ 5 Changed 6 months ago by cieply

I have checked that patch and it seems to work but I found analogical cases to those with .pdfs. Whenever you pack .pdf or .webm or .1/.2/.[0-9], or .jpg/.png/.gif/.bmp/.pnm/any image, same thing happens. I guess it has nothing to do with a suffix and everything with a recognized extension. Zip, rar, 7z, tar, whatever archive should not automatically execute any file in it in any case.

Last edited 6 months ago by cieply (previous) (diff)

comment:5 in reply to: ↑ 4 ; follow-up: ↓ 6 Changed 6 months ago by andrew_b

Replying to cieply:

I found analogical cases to those with .pdfs

What do you mean exactly?

comment:6 in reply to: ↑ 5 ; follow-up: ↓ 7 Changed 6 months ago by cieply

I found analogical cases to those with .pdfs

What do you mean exactly?

I said about pdfs in a first post. It happens with other extensions as well. If there is a file, with known suffix and is zipped then on enter it will be executed. It might make sens with .gz, .bz2, etc. but not with multi file archives like tar, zip, rar.

cp /usr/man/man1/cmp.1 cmp.1
zip m1.zip cmp.1

cp /usr/man/man1/cmp.1 cmp.1                                                                                                    cp /usr/man/man1/clear.1 clear.1                                                                                                  zip m2.zip cmp.1 clear.1

cp /usr/man/man1/cmp.1 cmp.1
cp /usr/man/man1/clear.1 clear.1
echo aaa > aaa.txt
echo zzz > zzz.txt
zip m3.zip cmp.1 clear.1 aaa.txt zzz.txt

Now you can't enter these archives. Instead they get "executed". what is executed? Some external, gui unarchiver in my case, which I don't necessarily want to use, using mc. You can't even view contents with F3. You get an error: <standard input>:2: warning: can't find character with input code 3

Same with files like pdfs, images, and so on.

zip img1.zip a.bmp

zip img2.zip a.bmp b.bmp

Sometimes if you add more files it stops doing that.

zip m5.zip /usr/man/man5/*

But in any way, it wasn't the case before.

comment:7 in reply to: ↑ 6 ; follow-up: ↓ 8 Changed 6 months ago by andrew_b

Replying to cieply:

Now you can't enter these archives. Instead they get "executed". what is executed? Some external, gui unarchiver in my case, which I don't necessarily want to use, using mc. You can't even view contents with F3. You get an error: <standard input>:2: warning: can't find character with input code 3

Everything fine for me. I can enter to these archives.

In #4141 format of mc.ext was changed and mc.ext parser was rewritten. Such behaviour was fixed too.

comment:8 in reply to: ↑ 7 Changed 6 months ago by cieply

Everything fine for me. I can enter to these archives.

Not for me though.

In #4141 format of mc.ext was changed and mc.ext parser was rewritten. Such behaviour was fixed too.

Well, there is only 4.8.28 available for download.
How can I fix it then?

BTW. if changes are so deep, why won't you call new version 4.9? Maybe keeping build count. That would be 4.9.29. Major version and then minor are more important than "build" or whatever you call the last number.

comment:9 follow-up: ↓ 10 Changed 6 months ago by zaytsev

We will try to make a new release over the holidays. It's long due, but very unfortunately, I was not able to find time to support andrew_b so far. Had to deal with some unexpected infra migration in the time allocated for release instead.

comment:10 in reply to: ↑ 9 Changed 6 months ago by cieply

We will try to make a new release over the holidays

It was a digression. I put it in right thread.

I wondered how to fix it, not when a new release is going to be.
I tried to compare diff with 4.8.16 but it didn't help me in finding it.

Last edited 6 months ago by cieply (previous) (diff)

comment:11 Changed 5 months ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:12 Changed 5 months ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:13 Changed 5 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.