You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `CARGO_UNSTABLE_SAFE_DIRECTORIES=true` environment variable enables a mode where Cargo will check the ownership of `Cargo.toml` and `config.toml` files.
1427
+
If the files are owned by a user different from the current user,
1428
+
then Cargo will generate an error.
1429
+
This is a security mechanism to ensure that a malicious user doesn't add one of those files in a parent directory of wherever you run `cargo`.
1430
+
See the RFC for more details.
1431
+
1432
+
The ownership check can be overridden with the `safe.directories` configuration setting.
1433
+
This is an array of paths that you explicitly trust even if they are owned by another user.
1434
+
1435
+
```toml
1436
+
[safe]
1437
+
directories = ["/path/to/project"]
1438
+
```
1439
+
1440
+
This config setting may only be set in the [Cargo home directory](../guide/cargo-home.md).
1441
+
Other file locations are not allowed.
1442
+
1443
+
This config option can also be set with the `CARGO_SAFE_DIRECTORIES` or `RUSTUP_SAFE_DIRECTORIES` environment variables.
1444
+
Multiple paths may be separated with `:` on Unix-like environments or `;` for Windows environments.
1445
+
1446
+
An entry of an asterisk (such as `CARGO_SAFE_DIRECTORIES=*`) entirely disables the ownership check for all paths.
1447
+
1448
+
1420
1449
## Stabilized and removed features
1421
1450
1422
1451
### Compile progress
@@ -1597,4 +1626,4 @@ See the [Features chapter](features.md#dependency-features) for more information
1597
1626
1598
1627
The `-Ztimings` option has been stabilized as `--timings` in the 1.60 release.
1599
1628
(`--timings=html` and the machine-readable `--timings=json` output remain
0 commit comments