Create a directory (and parents) with owner-only permissions (`0o700`) on Unix. On non-Unix platforms, falls back to default permissions. This should be used for any directory that contains sensitive material (tokens, private keys, certificates).
(path: &Path)
| 68 | /// This should be used for any directory that contains sensitive material |
| 69 | /// (tokens, private keys, certificates). |
| 70 | pub fn create_dir_restricted(path: &Path) -> Result<()> { |
| 71 | std::fs::create_dir_all(path) |
| 72 | .into_diagnostic() |
| 73 | .wrap_err_with(|| format!("failed to create {}", path.display()))?; |
| 74 | set_dir_owner_only(path)?; |
| 75 | Ok(()) |
| 76 | } |
| 77 | |
| 78 | /// Set a directory to owner-only access (`0o700`) on Unix. |
| 79 | /// |