mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-18 09:23:10 +00:00
Merge pull request #2183 from dgibson/mountinfo-misparse
agent: Fix to parsing of /proc/self/mountinfo
This commit is contained in:
commit
8c921e69ec
@ -923,12 +923,12 @@ pub fn get_mounts() -> Result<HashMap<String, String>> {
|
|||||||
let paths = get_paths()?;
|
let paths = get_paths()?;
|
||||||
|
|
||||||
for l in fs::read_to_string(MOUNTS)?.lines() {
|
for l in fs::read_to_string(MOUNTS)?.lines() {
|
||||||
let p: Vec<&str> = l.split(" - ").collect();
|
let p: Vec<&str> = l.splitn(2, " - ").collect();
|
||||||
let pre: Vec<&str> = p[0].split(' ').collect();
|
let pre: Vec<&str> = p[0].split(' ').collect();
|
||||||
let post: Vec<&str> = p[1].split(' ').collect();
|
let post: Vec<&str> = p[1].split(' ').collect();
|
||||||
|
|
||||||
if post.len() != 3 {
|
if post.len() != 3 {
|
||||||
warn!(sl!(), "mountinfo corrupted!");
|
warn!(sl!(), "can't parse {} line {:?}", MOUNTS, l);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user