runtime-rs: clear OCI spec namespace path

None of the host namespace paths make sense in the guest. Let's clear
them all before sending the spec to the agent.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2022-12-12 11:07:14 +00:00
parent 62f4603e81
commit 79cf38e6ea

View File

@ -403,7 +403,10 @@ fn amend_spec(spec: &mut oci::Spec, disable_guest_seccomp: bool) -> Result<()> {
for n in linux.namespaces.iter() {
match n.r#type.as_str() {
oci::PIDNAMESPACE | oci::NETWORKNAMESPACE => continue,
_ => ns.push(n.clone()),
_ => ns.push(oci::LinuxNamespace {
r#type: n.r#type.clone(),
path: "".to_string(),
}),
}
}