Merge pull request #2183 from dgibson/mountinfo-misparse

agent: Fix to parsing of /proc/self/mountinfo
This commit is contained in:
Fabiano Fidêncio 2021-07-10 13:07:12 +02:00 committed by GitHub
commit 8c921e69ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -923,12 +923,12 @@ pub fn get_mounts() -> Result<HashMap<String, String>> {
let paths = get_paths()?;
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 post: Vec<&str> = p[1].split(' ').collect();
if post.len() != 3 {
warn!(sl!(), "mountinfo corrupted!");
warn!(sl!(), "can't parse {} line {:?}", MOUNTS, l);
continue;
}