Skip to content
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

deb file incorrectly matching to ar #126

Open
pdinfinera opened this issue Jan 17, 2023 · 1 comment
Open

deb file incorrectly matching to ar #126

pdinfinera opened this issue Jan 17, 2023 · 1 comment

Comments

@pdinfinera
Copy link

pdinfinera commented Jan 17, 2023

I have a deb file and after running the following code I get kind.Extension is ar instead of deb

buf, _ := ioutil.ReadFile("foo.deb")
kind, _ filetype.Match(buf)
fmt.Print(kind.Extension)
fmt.Print(kind.MIME.Value)

Output

ar
application/x-unix-archive

On other tries, I see the following output

deb
application/vnd.debian.binary-package

I'm guessing that it's due to arMagic and debMagic sharing the same first 7 bytes and that the ar matcher is sometimes running before deb matcher. Since arMagic and debMagic are added to a map, there's no guarantee as to the order when they get registered.

@bokunodev
Copy link

deb format is ar with some debian package manifest files included in it.

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

No branches or pull requests

2 participants