@@ -11,8 +11,6 @@ use crate::{
|
||||
utils::{self, umask},
|
||||
};
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
use crate::pty::prepare_pty;
|
||||
#[cfg(any(target_os = "linux", target_os = "android"))]
|
||||
use rustix::{
|
||||
process::getuid,
|
||||
@@ -140,7 +138,6 @@ pub fn root_shell() -> Result<()> {
|
||||
"Specify a supplementary group. The first specified supplementary group is also used as a primary group if the option -g is not specified.",
|
||||
"GROUP",
|
||||
);
|
||||
opts.optflag("", "no-pty", "Do not allocate a new pseudo terminal.");
|
||||
|
||||
// Replace -cn with -z, -mm with -M for supporting getopt_long
|
||||
let args = args
|
||||
@@ -268,13 +265,6 @@ pub fn root_shell() -> Result<()> {
|
||||
command = command.env("ENV", defs::KSURC_PATH);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
if !matches.opt_present("no-pty") {
|
||||
if let Err(e) = prepare_pty() {
|
||||
log::error!("failed to prepare pty: {:?}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// escape from the current cgroup and become session leader
|
||||
// WARNING!!! This cause some root shell hang forever!
|
||||
// command = command.process_group(0);
|
||||
|
||||
Reference in New Issue
Block a user