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

Function ensure_parent_dir_restricted

crates/openshell-core/src/paths.rs:114–119  ·  view source on GitHub ↗

Ensure the parent directory of `path` exists with restricted permissions. Equivalent to `create_dir_restricted(path.parent())` but handles the case where `path` has no parent gracefully.

(path: &Path)

Source from the content-addressed store, hash-verified

112/// Equivalent to `create_dir_restricted(path.parent())` but handles the case
113/// where `path` has no parent gracefully.
114pub fn ensure_parent_dir_restricted(path: &Path) -> Result<()> {
115 if let Some(parent) = path.parent() {
116 create_dir_restricted(parent)?;
117 }
118 Ok(())
119}
120
121/// Check whether a file has permissions that are too open (group/other readable).
122///

Callers 6

store_gateway_metadataFunction · 0.85
save_active_gatewayFunction · 0.85
save_last_sandboxFunction · 0.85
store_edge_tokenFunction · 0.85
store_oidc_tokenFunction · 0.85
default_database_urlFunction · 0.85

Calls 1

create_dir_restrictedFunction · 0.85

Tested by

no test coverage detected