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

Device: Fix diskAddRootUserNSEntry to add root mapping only if it's required #13332

Merged
merged 1 commit into from
Apr 16, 2024

Commits on Apr 15, 2024

  1. lxd/device/device_utils_disk: fix diskAddRootUserNSEntry to add root …

    …mapping only if it's required
    
    Fix diskAddRootUserNSEntry logic to correcly handle case when
    we have not-groupped UID/GID mapping like this:
    [{true false 1000 0 1} {false true 1000 0 1}]
    
    because right now it assumes that mapping should be like
    [{true true 1000 0 1}]
    
    which is logically equivalent.
    
    This become noticable after my change in canonical#12718, before that
    this issue in logic was reproducible only if user will do something like this:
      cat << EOF
    uid $(id -u) 1000000
    gid $(id -g) 1000000
    EOF
      ) | lxc config set idmap raw.idmap -
    which is an extremely rare usecase.
    
    Fixes: canonical#13325
    Signed-off-by: Alexander Mikhalitsyn <[email protected]>
    mihalicyn committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    88f7093 View commit details
    Browse the repository at this point in the history