Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mountinfo: fix path unescaping #16

Merged
merged 2 commits into from
Jun 24, 2020
Merged

Commits on Jun 23, 2020

  1. mountinfo: fix path unescaping

    Moby PR #38977 [1] and containerd PR #3159 [2] added the handing of
    escape sequences in mountinfo paths (root and mountpoint fields).
    
    Unfortunately, it also broke the handling of paths containing double
    quotes, as it was pointed out in [3].
    
    The solution is to stop using strconv.Unquote and write our own
    specialized function to deal with escape sequences.
    
    Unit tests added.
    
    [1] moby/moby#38977
    [2] containerd/containerd#3159
    [3] containerd/containerd#4257
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    504ee4b View commit details
    Browse the repository at this point in the history
  2. mountinfo: also unescape fstype and source

    Just noticed it while reading the kernel source code (function
    show_mountinfo() in fs/proc_namespace.c; see also: show_type(),
    mangle()) that the first two fields after the `-` separator are also
    escaped.
    
    While I haven't seen it in real life, it's better we unescape them.
    
    No field-specific tests were added, and unescape() is tested by its own
    test case.
    
    Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
    kolyshkin committed Jun 23, 2020
    Configuration menu
    Copy the full SHA
    0b171c2 View commit details
    Browse the repository at this point in the history