Add option to enable global namespace (#497)
Disabled by default. To enable/disable use terminal with root. To enable: echo 1 > /sys/module/ksu/parameters/global_namespace_enable To disable: echo 0 > /sys/module/ksu/parameters/global_namespace_enable Value will be reset to 0 (disabled) on reboot.
This commit is contained in:
@@ -229,7 +229,10 @@ pub fn root_shell() -> Result<()> {
|
||||
|
||||
// switch to global mount namespace
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
if mount_master {
|
||||
let global_namespace_enable =
|
||||
std::fs::read_to_string("/sys/module/ksu/parameters/global_namespace_enable")
|
||||
.unwrap_or("0".to_string());
|
||||
if global_namespace_enable.trim() == "1" || mount_master {
|
||||
let _ = utils::switch_mnt_ns(1);
|
||||
let _ = utils::unshare_mnt_ns();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user