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

Support for .deb .rpm .cpio? #125

Open
ducktype opened this issue Nov 30, 2018 · 8 comments
Open

Support for .deb .rpm .cpio? #125

ducktype opened this issue Nov 30, 2018 · 8 comments

Comments

@ducktype
Copy link

I think will be cool to support .deb and .rpm and probably others linux packages formats
.deb are custom wrapped tar.gz/tar.bz2/tar.xz/tar.lz4/tar.sz archives
.rpm are custom wrapped cpio archives
the only program that handle these archive types that i'm aware of is 7zip that have a linux port p7zip, but in the latest versions of 7zip some problems arise and i needed to use an older version, having a multiplatform/dependencies free archiver that handle also that common type of linux packages will be great, for my needs will be enought to have the extract operation!

What do you think about that?
thank you in advice :)

@mholt
Copy link
Owner

mholt commented Nov 30, 2018

Sure, pull requests welcome to add additional archive formats.

@mholt
Copy link
Owner

mholt commented Dec 2, 2018

@ducktype Hey actually, I just updated the issue templates. Would you mind re-creating one issue per format using the template specifically for requesting new archive formats? Thanks!

@mholt mholt closed this as completed Dec 2, 2018
@ahrav
Copy link

ahrav commented Aug 15, 2023

Only 5 years later 🤣 trufflesecurity/trufflehog#1625

@mholt
Copy link
Owner

mholt commented Aug 16, 2023

@ahrav That could be a reference implementation, yeah? Feel free to make a PR if we can / want to use it!

@ahrav
Copy link

ahrav commented Aug 16, 2023

@ahrav That could be a reference implementation, yeah? Feel free to make a PR if we can / want to use it!

Yea that's correct. It's not a great solution, but it does provide us a way to extract .rpm and .deb file formats. It's really just a convenience helper to extract the files into tarballs which your pkg then nicely takes care of.

@mholt
Copy link
Owner

mholt commented Aug 16, 2023

Very cool :)

@ducktype
Copy link
Author

ducktype commented Aug 16, 2023

Seems the proposed solution uses external commands, i feel archiver should handle extractions by itself and also avoid double copying the archive.

There are native golang libs, also recently updated, that handle ar (Deb) and cpio (RPM) formats

https://pkg.go.dev/pault.ag/go/debian/deb
https://pkg.go.dev/github.com/u-root/u-root/pkg/cpio

RPM add some header before the cpio stream so some code to parse and skip to the start cpio offset Is required i think this lib have some of that stuff, but Is old:

https://pkg.go.dev/github.com/sassoftware/go-rpmutils

@mholt mholt reopened this Aug 16, 2023
@taoxinyi
Copy link

Would like to see support for .rpm as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants