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)
| 112 | /// Equivalent to `create_dir_restricted(path.parent())` but handles the case |
| 113 | /// where `path` has no parent gracefully. |
| 114 | pub 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 | /// |
no test coverage detected