MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / is_under_sandbox_workspace

Function is_under_sandbox_workspace

crates/openshell-cli/src/ssh.rs:880–882  ·  view source on GitHub ↗

Pure helper: is `path` equal to `/sandbox` or a descendant of it?

(path: &str)

Source from the content-addressed store, hash-verified

878
879/// Pure helper: is `path` equal to `/sandbox` or a descendant of it?
880fn is_under_sandbox_workspace(path: &str) -> bool {
881 path == SANDBOX_WORKSPACE_ROOT || path.starts_with(&format!("{SANDBOX_WORKSPACE_ROOT}/"))
882}
883
884/// Resolve every symlink in `sandbox_path` on the sandbox side and refuse the
885/// result if it lands outside `/sandbox`.

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected