mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
fix: restrict droplet shim permissions and annotate test range (SonarCloud) (#8870)
The generated droplet shim only needs to run as its creator, so 0700 keeps other local accounts from reading the CLI path it invokes. The reversed range in the arrow-key test is the case under test, not an accident. 🤖 Generated with Codebuff Co-authored-by: Codebuff <noreply@codebuff.com>
This commit is contained in:
co-authored by
Codebuff
parent
f346b5c8f4
commit
f27656b910
@@ -358,7 +358,9 @@ fn write_shim(droplet: &str) -> Result<String> {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
let _ = std::fs::set_permissions(&shim, std::fs::Permissions::from_mode(0o755));
|
||||
// The shim only has to run as the user who created it; 0o755 would also let every other
|
||||
// local account read and execute it.
|
||||
let _ = std::fs::set_permissions(&shim, std::fs::Permissions::from_mode(0o700));
|
||||
}
|
||||
Ok(shim)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user