mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-28 20:41:04 +00:00
Merge pull request #694 from lifupan/2.0-dev
rustjail: fix the issue of invalid cgroup_parent path
This commit is contained in:
commit
e3ea8544f4
@ -1389,10 +1389,6 @@ impl Manager {
|
|||||||
pub fn new(cpath: &str) -> Result<Self> {
|
pub fn new(cpath: &str) -> Result<Self> {
|
||||||
let mut m = HashMap::new();
|
let mut m = HashMap::new();
|
||||||
|
|
||||||
if !cpath.starts_with('/') {
|
|
||||||
return Err(nix::Error::Sys(Errno::EINVAL).into());
|
|
||||||
}
|
|
||||||
|
|
||||||
let paths = get_paths()?;
|
let paths = get_paths()?;
|
||||||
let mounts = get_mounts()?;
|
let mounts = get_mounts()?;
|
||||||
|
|
||||||
@ -1404,9 +1400,9 @@ impl Manager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let p = if value == "/" {
|
let p = if value == "/" {
|
||||||
format!("{}{}", mnt.unwrap(), cpath)
|
format!("{}/{}", mnt.unwrap(), cpath)
|
||||||
} else {
|
} else {
|
||||||
format!("{}{}{}", mnt.unwrap(), value, cpath)
|
format!("{}{}/{}", mnt.unwrap(), value, cpath)
|
||||||
};
|
};
|
||||||
|
|
||||||
m.insert(key.to_string(), p);
|
m.insert(key.to_string(), p);
|
||||||
|
Loading…
Reference in New Issue
Block a user