mirror of https://github.com/astral-sh/uv
Use 666 rather than 644 for default permissions (#5498)
## Summary
I don't know why I used 644 here. 666 is the actual default:
7c2012d0ec/library/std/src/sys/pal/unix/fs.rs (L1069)
Closes https://github.com/astral-sh/uv/issues/5496.
This commit is contained in:
parent
623ba3885f
commit
4f3dde34dc
|
|
@ -103,13 +103,13 @@ pub fn replace_symlink(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> std::io:
|
||||||
|
|
||||||
/// Return a [`NamedTempFile`] in the specified directory.
|
/// Return a [`NamedTempFile`] in the specified directory.
|
||||||
///
|
///
|
||||||
/// Sets the permissions of the temporary file to `0o644`, to match the non-temporary file default.
|
/// Sets the permissions of the temporary file to `0o666`, to match the non-temporary file default.
|
||||||
/// ([`NamedTempfile`] defaults to `0o600`.)
|
/// ([`NamedTempfile`] defaults to `0o600`.)
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub fn tempfile_in(path: &Path) -> std::io::Result<NamedTempFile> {
|
pub fn tempfile_in(path: &Path) -> std::io::Result<NamedTempFile> {
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
tempfile::Builder::new()
|
tempfile::Builder::new()
|
||||||
.permissions(std::fs::Permissions::from_mode(0o644))
|
.permissions(std::fs::Permissions::from_mode(0o666))
|
||||||
.tempfile_in(path)
|
.tempfile_in(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue