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

Suggestion: add an unpack goal to the plugin #47

Closed
frosiere opened this issue Nov 28, 2019 · 5 comments
Closed

Suggestion: add an unpack goal to the plugin #47

frosiere opened this issue Nov 28, 2019 · 5 comments

Comments

@frosiere
Copy link

In some situations, it would be very useful to have a goal to unpack the content of a given RPM.

This goal would simply extract the content of the rpm in a given directory.

@ctron
Copy link
Owner

ctron commented Nov 29, 2019

Indeed, a nice idea. Could you contribute such a feature?

@dranuhl
Copy link
Contributor

dranuhl commented Nov 19, 2021

I have tried myself to write an unpack mojo, which would just unpack the RPM file content similar as a rpm2cpio | cpio -idm would do.

My code still needs some work:

  • add more security checks on the file name(s) within the archive
  • last modification time should be set if possible by underlying file system and user permissions
  • add some integration test
  • adapt my Java code style to existing project one :-)

Limitations of the current draft implementation:

  • symbolic links would be ignored, even if the Java Nio FileSystem might support it
  • only directories and regular files will be written (devices, pipes, networks, etc will be ignored)
  • currently it would just always override any existing file
  • file ownership (uid) will be ignored
  • no file selection/filtering
  • no directory stripping
  • any RPM with "../" in the path would abort the extraction (avoid path traversal issues)
  • Mojo marked as not thread safe as Apache Compress CPIO is not (should not be an issue, but just in case)

The Mojo would currently just have 2 parameters rpm.file and rpm.unpackDirectory. It would not even require a project.

So stay tuned... PR will hopefully follow soon.

dranuhl added a commit to dranuhl/rpm-builder that referenced this issue Nov 20, 2021
dranuhl added a commit to dranuhl/rpm-builder that referenced this issue Nov 22, 2021
ctron pushed a commit that referenced this issue Nov 29, 2021
@dranuhl
Copy link
Contributor

dranuhl commented Nov 29, 2021

This has been fixed by #57 and so could probably be closed.

@ctron
Copy link
Owner

ctron commented Nov 30, 2021

True, I will close it once I got it released.

Which might take a bit longer than expected, because I am busy with another release, that unfortunately requires a bit more attention at the moment than anticipated.

@ctron
Copy link
Owner

ctron commented Nov 30, 2021

Many thanks @dranuhl for the contribution!

@ctron ctron closed this as completed Nov 30, 2021
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

3 participants