-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
A Cargo.toml
file in parent directory which you cannot delete prevents cargo from building anything
#12080
Comments
Thanks for describing the scenario well! This looks like effectively what rust-lang/rfcs#3279 tries to address. There are some open pull requests for it: They got stale for a while. Hope we can move them forward someday. Going to close this in favor of things above. Thank you. |
A workaround would be to add the Something we might explore for rust-lang/rfcs#3424 is modifying |
Also maybe cargo should treat 'Cargo.toml is a directory or we have insufficient permissions' as 'Cargo.toml does not exist'? |
Problem
On a shared system, there is a directory (weirdly, but it could've been a file) named
Cargo.toml
under$HOME/..
. It is owned by root with 000 permission. As the parent directory still hasr
permission, a cargo project under$HOME
cannot be built as cargo will detect the badCargo.toml
, attempt to access it and then error out with permission denied.A root user could put a
Cargo.toml
under/
which acts a system-wide DoS against cargo for other users.I know this recursive look up is expected behaviour, but it doesn't really play well with file permissions on shared systems. This is unlike
.cargo/config.toml
where each user can override the parent directory with a more specific one.Steps
No response
Possible Solution(s)
Add a flag, say
--workspace-lookup-depth=n
, to prevent cargo from looking more thann
levels up the file systemNotes
No response
Version
No response
The text was updated successfully, but these errors were encountered: