Skip to content

Commit 512cf4b

Browse files
committed
fix(supervisor-process): broaden Path import cfg to all unix targets
The `Path` import was gated on `cfg(any(test, target_os = "linux"))`, but `prepare_read_write_path` is gated on `cfg(unix)` — broader. On non-Linux unix the function still referenced `&std::path::Path` explicitly, so upstream's qualified path was load-bearing. After the supervisor split, lint runs on Linux where `Path` IS in scope, so `unused_qualifications` fires. Broaden the import cfg to match the function's cfg and use the bare `Path` name everywhere. Signed-off-by: Radoslav Hubenov <[email protected]>
1 parent 009dc33 commit 512cf4b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎crates/openshell-supervisor-process/src/process.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::ffi::CString;
1919
use std::os::fd::{AsRawFd, OwnedFd, RawFd};
2020
#[cfg(target_os = "linux")]
2121
use std::os::unix::ffi::OsStrExt;
22-
#[cfg(any(test, target_os = "linux"))]
22+
#[cfg(any(test, unix))]
2323
use std::path::Path;
2424
use std::path::PathBuf;
2525
use std::process::Stdio;
@@ -791,7 +791,7 @@ pub fn validate_sandbox_user(policy: &SandboxPolicy) -> Result<()> {
791791
/// still needs to be chowned to the sandbox user/group. Existing paths keep
792792
/// their image-defined ownership.
793793
#[cfg(unix)]
794-
fn prepare_read_write_path(path: &std::path::Path) -> Result<bool> {
794+
fn prepare_read_write_path(path: &Path) -> Result<bool> {
795795
// SECURITY: use symlink_metadata (lstat) to inspect each path *before*
796796
// calling chown. chown follows symlinks, so a malicious container image
797797
// could place a symlink (e.g. /sandbox -> /etc/shadow) to trick the

0 commit comments

Comments
 (0)