(root: &Dir, target: &Utf8Path)
| 98 | /// Given a target path, remove its immutability if present |
| 99 | #[context("Removing immutable flag from {target}")] |
| 100 | pub(crate) fn remove_immutability(root: &Dir, target: &Utf8Path) -> Result<()> { |
| 101 | use anyhow::ensure; |
| 102 | |
| 103 | tracing::debug!("Target {target} is a mountpoint, remounting rw"); |
| 104 | let st = Command::new("chattr") |
| 105 | .args(["-i", target.as_str()]) |
| 106 | .cwd_dir(root.try_clone()?) |
| 107 | .status()?; |
| 108 | |
| 109 | ensure!(st.success(), "Failed to remove immutability: {st:?}"); |
| 110 | |
| 111 | Ok(()) |
| 112 | } |
| 113 | |
| 114 | pub(crate) fn spawn_editor(tmpf: &tempfile::NamedTempFile) -> Result<()> { |
| 115 | let editor_variables = ["EDITOR"]; |
no test coverage detected