(
image_path: &Path,
guest_path: &str,
mode: u32,
)
| 183 | } |
| 184 | |
| 185 | pub fn set_rootfs_image_file_mode( |
| 186 | image_path: &Path, |
| 187 | guest_path: &str, |
| 188 | mode: u32, |
| 189 | ) -> Result<(), String> { |
| 190 | let regular_file_mode = 0o100_000 | (mode & 0o7777); |
| 191 | let Some(quoted_guest_path) = debugfs_quote_absolute_path(guest_path) else { |
| 192 | return Err(format!("invalid debugfs guest path '{guest_path}'")); |
| 193 | }; |
| 194 | run_debugfs( |
| 195 | image_path, |
| 196 | &format!("set_inode_field {quoted_guest_path} mode 0{regular_file_mode:o}"), |
| 197 | ) |
| 198 | } |
| 199 | |
| 200 | #[cfg(target_os = "macos")] |
| 201 | fn try_clone_file(source: &Path, dest: &Path) -> Result<(), String> { |
no test coverage detected