Skip to content

subid ranges are ignored for owners/users that have no passwd entry (v4.2.0) #1710

Description

@ffernand

Sub ID ranges whose owner/user has no /etc/passwd entry are silently ignored. getsubids reports no ranges for such a user even though the entry is present in /etc/subuid. Entries owned by a name that deliberately has no account are now silently invisible.

Reproduction

$ printf 'phantom:900000:65536\n' | sudo tee -a /etc/subuid
$ getsubids phantom
Error fetching ranges
$ echo $?
1

Entries in the same file owned by an existing account are unaffected and return their ranges normally. The only thing that differs is whether the owner exists in /etc/passwd.

I discovered this when using Podman's rootful --userns=auto, resulting in this error...

ERRO[0000] Cannot find mappings for user "containers": no subuid ranges found for user "containers" in /etc/subuid
Error: creating container storage: not enough unused IDs in user namespace

Podman allocates ranges from an owner named containers, and it's mentioned in a podman discussion that it doesn't need to be a real account (though this might be advice no longer relevant).

podman-container-tools/podman#24951

I couldn't tell if requiring a passwd entry is intentional or not. But until 4.20 it wasn't required...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions