- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve handling of compressed content in mc.ext #4128
Comments
|
|
|
It would be awesome if someone did something to ts - right now it is always regarded as a video file. This might have been reasonable before the advent of TypeScript, but now most of TS-files are actually code.
Unfortunately file is not perfect:
Maybe match on text before video? |
that's one hell of an overloaded extension:
(this extension predates typescript by over a decade.)
we can keep the order, but need to switch to content detection:
|
|
heh, FAIL.
(so basically AND conditions by stacking.)
i'd suggest to create a new ticket (and possibly delete the kinda off-topic comments here). |
Feedback from Ubuntu user:
https://bugs.launchpad.net/ubuntu/+source/mc/+bug/2097560
I have a zip file where the first enclosed file is PDF. For a reason (I strictly prefer okular over evince and was lazy to find another place to set the priority), I changed the mc extension file (mc.ext) entry to the following:
Unexpectedly, this caused misopening of some zip files. Checking what is happening by strace showed that mc calls file with arguments to detect the enclosed contents:
and this file helper returns:
The rule in the extension file detects, according to "^PDF", this is PDF and runs okular instead of ark for this file. Okular deliberately rejects opening zip.
With the default extension file contents:
the bug still has place but is masked because passing through doc.sh and then xdg-open rechecks the file type using file (technically, with kioslave5) without -z that allows proper detection.
So using simple file/ rules in mc extension file is incompatible with using file -z for deeper analysis (if this deeper analysis has sense in general).
Iʼm uncertain for security impact but it could have taken place in a more complicated scenario. |
I'm not sure what the best way is to solve this problem universally. I think our Type= rules could/should exclude compressed? ossi, can you do something about this? |
|
|
dunno, depends on how stupid file really is.
hmm, apparently very - file -z on an .odt file bugs out a gzip error. this is doubly bogus, as these are zip and not gzip files.
that it aggressively peeks contents of multi-file archives is also extremely questionable. it doesn't do that for tar files.
maybe that release of file is just really botched? this is file-5.45 from recent debian unstable. |
Some experiments on my machine (macOS):
It would really help if you could please explain what did you want to achieve and how it was supposed to work? To me it seems that -z, which is documented as "Try to look inside compressed files" does exactly what it says.
My guess is that you wanted to simplify / make the detection of man stuff (or, generally, compressed data for which we have special handling) more reliable.
In this case, maybe the solution is to make sure that we put the archives first, unless we have special support for compressed data. If we do, then these entries should come first. Can you look into this and make a patch? |
ok, i had a closer look.
yes, this seems like what we should do. |
Created new ticket as suggested - #4649. I would appreciate any help - editing the ticket itself, and of course working on the rules.
I'm now trying to focus my time on researching a proper GitHub migration, as we don't want an improper one, and a proper one requires tons of work for which there are no other takers :( |
|
Important
This issue was migrated from Trac:
ossi
(@ossilator)netch@….kiev.ua
this may be controversial - there is a related thread at https://mail.gnome.org/archives/mc/2005-June/thread.html#00022, though one would expect it to be outdated by now. i've been using this code for a very long time.
Note
Original attachments:
ossi
(@ossilator) onOct 8, 2020 at 22:40 UTC
The text was updated successfully, but these errors were encountered: