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

Fix absolute paths being extracted outside of destination directory #83

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

rohan-b99
Copy link
Contributor

@rohan-b99 rohan-b99 commented Jun 21, 2022

Fixes #84

@otavio
Copy link
Member

otavio commented Jun 21, 2022

@rohan-b99 thanks for sending the issue and PR. Please:

  • fix the code formatting error
  • add a more detailed commit log explaining the issue
  • add an entry in CHANGES file

so we can merge it.

@coveralls
Copy link

coveralls commented Jun 21, 2022

Pull Request Test Coverage Report for Build 2536773625

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 85.788%

Totals Coverage Status
Change from base Build 2017635506: 0.07%
Covered Lines: 332
Relevant Lines: 387

💛 - Coveralls

@rohan-b99
Copy link
Contributor Author

Done (I think - let me know if any more changes are needed)

…ipping leading '/'

Previously, an absolute entry path would be joined with the destination, but in Rust joining an absolute path onto another one will just return the absolute path which results in files being extracted outside of the destination directory. This commit changes the behaviour to strip the leading '/' from an absolute path, matching behaviour from bsdtar and gnu tar which will extract the files into the destination directory.
@rohan-b99
Copy link
Contributor Author

Fixed formatting, turns out I had an outdated nightly locally

@otavio otavio merged commit b72ec2c into OSSystems:master Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Absolute paths in archives will be extracted outside of destination directory
3 participants