Skip to content

Conversation

@e3krisztian
Copy link
Contributor

MAGIC_CONTINUE is more transparently supported with python-magic.
Also file-magic's last release was in 2018,
while there are recent changes on github.

@e3krisztian e3krisztian requested a review from martonilles June 17, 2022 13:34
@e3krisztian e3krisztian force-pushed the magic-wrapper-change branch 2 times, most recently from 553155e to 23f2e01 Compare June 17, 2022 18:59
@e3krisztian
Copy link
Contributor Author

In Nix pulling in file-magic pulled also libmagic, somehow it does not happen with python-magic :(

@vlaci
Copy link
Contributor

vlaci commented Jun 20, 2022

In Nix pulling in file-magic pulled also libmagic, somehow it does not happen with python-magic :(

We did hard work to achieve that https://github.com/onekey-sec/unblob/blob/main/default.nix#L66

@e3krisztian e3krisztian force-pushed the magic-wrapper-change branch from 23f2e01 to d526a63 Compare June 20, 2022 10:54
@e3krisztian e3krisztian requested a review from martonilles June 20, 2022 10:58
@martonilles
Copy link
Contributor

I would extend the commit message explaining why we need neeed MAGIC_CONTINUE or keep_going:

file magic uses a rule-set to guess the file type, however as rules are added they could shadow each other. File magic uses rule priorities to determine which is the best matching rule, however this could shadow other valid matches as well, which could eventually break any further processing that depends on magic.
By enabling keep_going (which eventually enables MAGIC_CONTINUE) all matching patterns will be included in the magic string at the cost of being a bit slower, but increasing accuracy by no shadowing rules.

@e3krisztian e3krisztian force-pushed the magic-wrapper-change branch from d526a63 to 7a7cfd2 Compare June 20, 2022 11:50
file magic uses a rule-set to guess the file type, however as rules are added they could
shadow each other. File magic uses rule priorities to determine which is the best matching
rule, however this could shadow other valid matches as well, which could eventually break
any further processing that depends on magic.
By enabling keep_going (which eventually enables MAGIC_CONTINUE) all matching patterns
will be included in the magic string at the cost of being a bit slower, but increasing
accuracy by no shadowing rules.

MAGIC_CONTINUE is more transparently supported with python-magic.
Also file-magic's last release was in 2018,
while there are recent changes on github.
@e3krisztian e3krisztian force-pushed the magic-wrapper-change branch from 7a7cfd2 to c8a80de Compare June 20, 2022 11:51
@martonilles martonilles merged commit 64cade4 into main Jun 20, 2022
@martonilles martonilles deleted the magic-wrapper-change branch June 20, 2022 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants