-
Notifications
You must be signed in to change notification settings - Fork 51
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: resolving relative paths in symlinks #224
Conversation
feff9b7
to
89b6941
Compare
Thanks for the PR. It looks like there is a compilation error: https://github.com/nodejs/uvwasi/actions/runs/5854703133/job/15876962601 |
Sorry, I forgot to remove the unused variable 🤦🏼 and fixed another memory problem in tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be safe to merge provided we can include documentation to the project along the lines of it not providing a security sandbox so that we don't need to consider this PR from a security perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix: resolving relative paths in symlinks * remove unused variable * fix memory leak in tests * fix mistaken assertions for windows in tests
- update uvwasi to 0.0.20 - adjust tests to reflect udpated behaviour from nodejs/uvwasi#224 included in uvwasi 0.0.20 Signed-off-by: Michael Dawson <[email protected]>
- update uvwasi to 0.0.20 - adjust tests to reflect udpated behaviour from nodejs/uvwasi#224 included in uvwasi 0.0.20 Signed-off-by: Michael Dawson <[email protected]> PR-URL: #51355 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
- update uvwasi to 0.0.20 - adjust tests to reflect udpated behaviour from nodejs/uvwasi#224 included in uvwasi 0.0.20 Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs#51355 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
- update uvwasi to 0.0.20 - adjust tests to reflect udpated behaviour from nodejs/uvwasi#224 included in uvwasi 0.0.20 Signed-off-by: Michael Dawson <[email protected]> PR-URL: nodejs#51355 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
- update uvwasi to 0.0.20 - adjust tests to reflect udpated behaviour from nodejs/uvwasi#224 included in uvwasi 0.0.20 Signed-off-by: Michael Dawson <[email protected]> PR-URL: #51355 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
- update uvwasi to 0.0.20 - adjust tests to reflect udpated behaviour from nodejs/uvwasi#224 included in uvwasi 0.0.20 Signed-off-by: Michael Dawson <[email protected]> PR-URL: #51355 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
- update uvwasi to 0.0.20 - adjust tests to reflect udpated behaviour from nodejs/uvwasi#224 included in uvwasi 0.0.20 Signed-off-by: Michael Dawson <[email protected]> PR-URL: #51355 Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
This fixes nodejs/node#49107 (relative paths in symlinks resolved incorrectly).
When following a symbolic link that points to a target using a relative path, the
uvwasi__resolve_path()
function resolves and normalizes the link's target as a relative path starting fromfd->real_path
. This should be treated as a relative path starting from the parent directory of the symbolic link.For example, given the directory structure below:
When
fd->real_path
is.
, the link target for link is resolved as../source_file
, not./source_file
. As a result, this resolution ends with anENOTCAPABLE
error.