Podman: userns=keep-id creates unnamed user group

Created on 20 Aug 2020  路  6Comments  路  Source: containers/podman

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Container created with option --userns=keep-id gets the current user with the correct UID and GUID but the group does not have the user's name.

More info from the Toolbox realm: https://github.com/containers/toolbox/issues/523

Steps to reproduce the issue:

  1. podman run --rm --userns=keep-id alpine id

Describe the results you received:

uid=1000(omichal) gid=1000

Describe the results you expected:

uid=1000(omichal) gid=1000(omichal)

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

Output of podman version:

Version:      2.1.0-dev
API Version:  1
Go Version:   go1.15rc2
Built:        Thu Jan  1 01:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.16.0-dev
  cgroupVersion: v2
  conmon:
    package: conmon-2.0.21-0.3.dev.git5a6b2ac.fc33.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.21-dev, commit: 5c03a23398b94cf869f071128631ef7fd9153b3b'
  cpus: 8
  distribution:
    distribution: fedora
    version: "33"
  eventLogger: file
  hostname: harry-work
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.8.0-1.fc33.x86_64
  linkmode: dynamic
  memFree: 4838907904
  memTotal: 16656273408
  ociRuntime:
    name: crun
    package: crun-0.14.1-2.fc33.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 0.14.1
      commit: 598ea5e192ca12d4f6378217d3ab1415efeddefa
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.1.4-4.dev.giteecccdb.fc33.x86_64
    version: |-
      slirp4netns version 1.1.4+dev
      commit: eecccdb96f587b11d7764556ffacfeaffe4b6e11
      libslirp: 4.3.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.0
  swapFree: 12363067392
  swapTotal: 12708732928
  uptime: 46h 1m 14.24s (Approximately 1.92 days)
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - registry.centos.org
  - docker.io
store:
  configFile: /var/home/omichal/.config/containers/storage.conf
  containerStore:
    number: 13
    paused: 0
    running: 2
    stopped: 11
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.1.0-11.dev.git800011b.fc33.x86_64
      Version: |-
        fusermount3 version: 3.9.3
        fuse-overlayfs: version 1.1.0
        FUSE library version 3.9.3
        using FUSE kernel interface version 7.31
  graphRoot: /var/home/omichal/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 11
  runRoot: /run/user/1000/containers
  volumePath: /var/home/omichal/.local/share/containers/storage/volumes
version:
  APIVersion: 1
  Built: 0
  BuiltTime: Thu Jan  1 01:00:00 1970
  GitCommit: ""
  GoVersion: go1.15rc2
  OsArch: linux/amd64
  Version: 2.1.0-dev

Package info (e.g. output of rpm -q podman or apt list podman):

podman-2.1.0-0.169.dev.git162625f.fc33.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

Fedora Silverblue Rawhide (Rawhide.20200811.n.0)

kinbug

Most helpful comment

Now that Podman 2.0.5 has made it into Fedora 32, we really need to fix this. Otherwise this warning will begin to bother people every time they podman exec into a container:

/usr/bin/id: cannot find name for group ID 1000

All 6 comments

we'd have to create and manage /etc/group as well.

Isn't /etc bind mounted from the host on toolbox?

Hi @giuseppe!

Toolbox bind mounts /etc to /run/host/etc.

What's the way forward here?

Recently, --userns=keepid started actually creating the user, but apparently not the group.

Is it a mistake that it creates the user, or that it doesn't create the group?

The code to add the user is deliberate, but we did not make the code alter /etc/group as well, so we'll probably need to do that as well.

Now that Podman 2.0.5 has made it into Fedora 32, we really need to fix this. Otherwise this warning will begin to bother people every time they podman exec into a container:

/usr/bin/id: cannot find name for group ID 1000

This PR is merged.

Was this page helpful?
0 / 5 - 0 ratings