Skip to content

parseInfoFile does not handle spaces in filenames #38458

@remexre

Description

@remexre

Description

When using the "github.com/docker/docker/pkg/mount" package's Mounted function, it falsely claims that a certain path is not mounted when in fact it is. It appears that a path containing spaces is not properly unescaped from /proc/self/mountinfo before being compared.

Steps to reproduce the issue:

  1. mount /dev/sdx /mnt/foo\ bar
  2. call mount.Mounted("/mnt/foo bar")

Describe the results you received:

false, nil

Describe the results you expected:

true, nil

Additional information you deem important (e.g. issue happens only occasionally):

This is probably something to check for on non-Linux platforms too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions