Fix mc.ext.in rules order to avoid content handlers taking precedence over archive handlers #4649
Labels
area: core
Issues not related to a specific subsystem
prio: medium
Has the potential to affect progress
Milestone
Important
This issue was migrated from Trac:
zaytsev
(@zyv)ossi
(@ossilator),netch@….kiev.ua
See also: #4128, #4419
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.
The text was updated successfully, but these errors were encountered: