Skip to content

Conversation

@naoNao89
Copy link
Contributor

@naoNao89 naoNao89 commented Dec 16, 2025

The safety check from #786 got accidentally removed during #931's refactor. This brings it back paths with .. now use hashed names to stay contained.

Added 3 regression tests.

Fixes: #172

Copy link
Contributor

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, but I have some questions on the PR

Restore ParentDir check lost in rust-lang#931 refactoring.
Paths with '..' now hashed to stay within OUT_DIR.

- src/command_helpers: re-add Component::ParentDir check
- tests: 3 new regression tests
@naoNao89 naoNao89 force-pushed the fix/issue-172-parent-dir-regression branch from 0ce5a50 to 9afb903 Compare December 17, 2025 13:03
Copy link
Contributor

@NobodyXu NobodyXu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Adding more regressive tests to prevent bugs is always welcomed!

I'll rename the PR title to reflect that though

@NobodyXu NobodyXu changed the title fix(#172): prevent OUT_DIR escape for '..' file paths fix(#172): add regressive tests for preventing OUT_DIR escape for '..' file paths Dec 17, 2025
@NobodyXu NobodyXu merged commit 7c01d41 into rust-lang:main Dec 17, 2025
79 checks passed
@naoNao89 naoNao89 deleted the fix/issue-172-parent-dir-regression branch December 17, 2025 15:48
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.

Support libraries stored in parent directory

2 participants