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 directory traversal when workdir path is not readable #3080

Merged
merged 1 commit into from
Apr 10, 2023
Merged

Fix directory traversal when workdir path is not readable #3080

merged 1 commit into from
Apr 10, 2023

Conversation

zlotnleo
Copy link
Contributor

@zlotnleo zlotnleo commented Apr 8, 2023

This PR fixes an issue where pwd can return "." due to insufficient permissions, e.g. when switching users using the su command, which causes an infinite loop in the nvm_find_project_dir and nvm_find_up functions.

@ljharb
Copy link
Member

ljharb commented Apr 8, 2023

huh, never seen that. I’d prefer to have a test along with this fix.

@ljharb ljharb merged commit 0d9b5c2 into nvm-sh:master Apr 10, 2023
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.

2 participants