Skip to content

Commit

Permalink
Fix previous mount namespace root cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work committed Sep 26, 2023
1 parent 45cf6cc commit c990b71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/linux/namespaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ fn create_mount_namespace(bind_mounts: HashMap<PathBuf, libc::c_ulong>) -> Resul
let put_old = new_root.join(OLD_ROOT_DIR);

// Ensure new root is available as an empty directory.
fs::remove_dir_all(&new_root)?;
if new_root.exists() {
fs::remove_dir_all(&new_root)?;
}
fs::create_dir(&new_root)?;

// Create C-friendly versions for our paths.
Expand Down

0 comments on commit c990b71

Please sign in to comment.