You've already forked runc
mirror of
https://github.com/opencontainers/runc.git
synced 2025-08-08 12:42:06 +03:00
Look for " - " instead of just - as separator
- symbol can appear in any path Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
@@ -126,11 +126,11 @@ func getCgroupMountsHelper(ss map[string]bool, mi io.Reader) ([]Mount, error) {
|
||||
scanner := bufio.NewScanner(mi)
|
||||
for scanner.Scan() {
|
||||
txt := scanner.Text()
|
||||
sepIdx := strings.IndexByte(txt, '-')
|
||||
sepIdx := strings.Index(txt, " - ")
|
||||
if sepIdx == -1 {
|
||||
return nil, fmt.Errorf("invalid mountinfo format")
|
||||
}
|
||||
if txt[sepIdx+2:sepIdx+8] != "cgroup" {
|
||||
if txt[sepIdx+3:sepIdx+9] != "cgroup" {
|
||||
continue
|
||||
}
|
||||
fields := strings.Split(txt, " ")
|
||||
|
Reference in New Issue
Block a user