Don't unshare after entering global namespace (#2373)
Global namespace is usually used to publicly apply mounts so calling unshare after entering root namespace is not desired bahavior. This also keeps -M option same as Magisk.
This commit is contained in:
@@ -26,7 +26,6 @@ pub fn grant_root(global_mnt: bool) -> Result<()> {
|
||||
command.pre_exec(move || {
|
||||
if global_mnt {
|
||||
let _ = utils::switch_mnt_ns(1);
|
||||
let _ = utils::unshare_mnt_ns();
|
||||
}
|
||||
Result::Ok(())
|
||||
})
|
||||
@@ -263,7 +262,6 @@ pub fn root_shell() -> Result<()> {
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
if mount_master {
|
||||
let _ = utils::switch_mnt_ns(1);
|
||||
let _ = utils::unshare_mnt_ns();
|
||||
}
|
||||
|
||||
set_identity(uid, gid, &groups);
|
||||
|
||||
Reference in New Issue
Block a user