Skip to content

Commit

Permalink
Merge pull request containers#275 from cgwalters/unshare-idempotent
Browse files Browse the repository at this point in the history
install: Don't unshare if we have an external source
  • Loading branch information
cgwalters authored Jan 19, 2024
2 parents ac52673 + eb620cc commit ec59a16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@ async fn prepare_install(
let rootfs = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority())
.context("Opening /")?;

let external_source = source_opts.source_imgref.is_some();
let source = match source_opts.source_imgref {
None => {
let container_info = crate::containerenv::get_container_execution_info(&rootfs)?;
Expand Down Expand Up @@ -1004,7 +1005,7 @@ async fn prepare_install(

// Even though we require running in a container, the mounts we create should be specific
// to this process, so let's enter a private mountns to avoid leaking them.
if std::env::var_os("BOOTC_SKIP_UNSHARE").is_none() {
if !external_source && std::env::var_os("BOOTC_SKIP_UNSHARE").is_none() {
super::cli::ensure_self_unshared_mount_namespace().await?;
}

Expand Down

0 comments on commit ec59a16

Please sign in to comment.