diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-09-06 01:15:19 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2021-09-06 01:15:19 +0200 |
commit | a29b5f808d39cacd6981276015603aa68afdbc1e (patch) | |
tree | 5e047d39b57db095ad23f2cfa6bec5c784ffa153 /src/runner/runc/run.rs | |
parent | 339942b8fc3ba3a4300a0cab8adf00610255c8c2 (diff) | |
download | rebel-a29b5f808d39cacd6981276015603aa68afdbc1e.tar rebel-a29b5f808d39cacd6981276015603aa68afdbc1e.zip |
Use rm_rf crate instead of remove_dir_all()
remove_dir_all() fails to delete overlayfs directories due to missing
permissions.
Diffstat (limited to 'src/runner/runc/run.rs')
-rw-r--r-- | src/runner/runc/run.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/runner/runc/run.rs b/src/runner/runc/run.rs index 64a6d85..9fd88f7 100644 --- a/src/runner/runc/run.rs +++ b/src/runner/runc/run.rs @@ -1,8 +1,6 @@ use std::{ fs::{self, File}, - io, - path::Path, - process, + io, process, }; use nix::mount::{self, MsFlags}; @@ -50,9 +48,7 @@ fn init_task(task: &runner::Task) -> io::Result<()> { let task_build_dir = paths::join(&[&task_state_tmp_dir, paths::TASK_STATE_BUILD_SUBDIR]); let task_work_dir = paths::join(&[&task_state_tmp_dir, paths::TASK_STATE_WORK_SUBDIR]); - if Path::new(&task_state_tmp_dir).exists() { - fs::remove_dir_all(&task_state_tmp_dir)?; - } + rm_rf::ensure_removed(&task_state_tmp_dir).map_err(util::rm_rf_error)?; dir.create(&task_work_dir)?; dir.create(&task_build_dir)?; |