File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -775,7 +775,11 @@ pub(crate) fn exec_in_host_mountns(args: &[std::ffi::OsString]) -> Result<()> {
775
775
. ok_or_else ( || anyhow:: anyhow!( "Missing command" ) ) ?;
776
776
tracing:: trace!( "{cmd:?} {args:?}" ) ;
777
777
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" ) ?;
779
783
rustix:: process:: chdir ( "/" ) . context ( "chdir" ) ?;
780
784
// Work around supermin doing chroot() and not pivot_root
781
785
// https://github.com/libguestfs/supermin/blob/5230e2c3cd07e82bd6431e871e239f7056bf25ad/init/init.c#L288
You can’t perform that action at this time.
0 commit comments