diff --git a/src/agent/rustjail/src/container.rs b/src/agent/rustjail/src/container.rs index 291f19af1f..1e866d0d06 100644 --- a/src/agent/rustjail/src/container.rs +++ b/src/agent/rustjail/src/container.rs @@ -355,13 +355,13 @@ fn do_init_child(cwfd: RawFd) -> Result<()> { lazy_static::initialize(&NAMESPACES); lazy_static::initialize(&DEFAULT_DEVICES); - let init = std::env::var(INIT)?.eq(format!("{}", true).as_str()); + let init = std::env::var(INIT)?.eq("true"); - let no_pivot = std::env::var(NO_PIVOT)?.eq(format!("{}", true).as_str()); + let no_pivot = std::env::var(NO_PIVOT)?.eq("true"); let crfd = std::env::var(CRFD_FD)?.parse::().unwrap(); let cfd_log = std::env::var(CLOG_FD)?.parse::().unwrap(); - if std::env::var(PIDNS_ENABLED)?.eq(format!("{}", true).as_str()) { + if std::env::var(PIDNS_ENABLED)?.eq("true") { // get the pidns fd from parent, if parent had passed the pidns fd, // then get it and join in this pidns; otherwise, create a new pidns // by unshare from the parent pidns. @@ -1477,15 +1477,6 @@ fn get_namespaces(linux: &Linux) -> Vec { .namespaces() .clone() .unwrap_or_default() - .iter() - .map(|ns| { - let mut namespace = LinuxNamespace::default(); - namespace.set_typ(ns.typ()); - namespace.set_path(ns.path().clone()); - - namespace - }) - .collect() } pub fn setup_child_logger(fd: RawFd, child_logger: Logger) -> tokio::task::JoinHandle<()> {