MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / write_secure

Function write_secure

nodedb/src/control/security/keystore/vault.rs:291–297  ·  view source on GitHub ↗
(path: &std::path::Path, content: &[u8])

Source from the content-addressed store, hash-verified

289 /// Write a file with secure Unix permissions (0o600) for use in tests.
290 #[cfg(unix)]
291 fn write_secure(path: &std::path::Path, content: &[u8]) {
292 use std::io::Write as _;
293 let mut f = std::fs::File::create(path).unwrap();
294 f.write_all(content).unwrap();
295 drop(f);
296 std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o600)).unwrap();
297 }
298
299 #[tokio::test]
300 #[cfg(unix)]

Callers 4

vault_unwrap_happy_pathFunction · 0.70
vault_auth_error_pathFunction · 0.70

Calls 1

createFunction · 0.50

Tested by

no test coverage detected