Skip to content

Commit f00395c

Browse files
authored
Merge pull request #699 from cgwalters/install-use-rustix
install: Use rustix instead of nix in one place
2 parents 7715531 + 723ad8c commit f00395c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/src/install.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,11 @@ pub(crate) fn exec_in_host_mountns(args: &[std::ffi::OsString]) -> Result<()> {
775775
.ok_or_else(|| anyhow::anyhow!("Missing command"))?;
776776
tracing::trace!("{cmd:?} {args:?}");
777777
let pid1mountns = std::fs::File::open("/proc/1/ns/mnt").context("open pid1 mountns")?;
778-
nix::sched::setns(pid1mountns.as_fd(), nix::sched::CloneFlags::CLONE_NEWNS).context("setns")?;
778+
rustix::thread::move_into_link_name_space(
779+
pid1mountns.as_fd(),
780+
Some(rustix::thread::LinkNameSpaceType::Mount),
781+
)
782+
.context("setns")?;
779783
rustix::process::chdir("/").context("chdir")?;
780784
// Work around supermin doing chroot() and not pivot_root
781785
// https://github.com/libguestfs/supermin/blob/5230e2c3cd07e82bd6431e871e239f7056bf25ad/init/init.c#L288

0 commit comments

Comments
 (0)