Skip to content

Support subordinate user and group IDs provided by SSSD on enterprise FreeIPA set-ups #1074

Closed

Description

@mhjacks

Describe the bug

Toolbox currently seems to be hard-coded to look for subuid and subgid in /etc/sub{u,g}id respectively. These ids may now be provided by FreeIPA in a centralized way. Podman and buildah can both take advantage of this new mechanism; maybe toolbox should too

Steps how to reproduce the behaviour

  1. Enable centralized subid support in FreeIPA/IdM (subid: sss in /etc/nsswitch.conf)
  2. Remove /etc/sub{u,g}id entries for the user under test
  3. getsubids <user> should still return a valid subid range
  4. toolbox enter displays an error like this:
$ toolbox enter
Error: /etc/subgid and /etc/subuid don't have entries for user mjackson
See the podman(1), subgid(5), subuid(5) and usermod(8) manuals for more
information.

Expected behaviour
Toolbox should come up and be usable

Actual behaviour
Program reports error and refuses to proceed

Output of toolbox --version (v0.0.90+)
e.g., toolbox version 0.0.90

Toolbox package info (rpm -q toolbox)
toolbox-0.0.99.3-5.fc36.x86_64

Output of podman version

Client:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.3
Built:        Wed Jun 15 09:31:58 2022
OS/Arch:      linux/amd64

Podman package info (rpm -q podman)
podman-4.1.1-1.fc36.x86_64

Info about your OS
Fedora Workstation 36

Additional context
We recently troubleshot and fixed essentially the same issue in buildah: podman-container-tools/buildah#4063

Activity

  1. added
    1. Bug
    on Jul 5, 2022
  2. debarshiray commented on Aug 5, 2022

    @debarshiray
    Member

    Thanks for pointing this out.

    We started checking /etc/subgid and /etc/subuid for better error handling on hosts where the current user might have been created long ago with an old version of shadow-utils.

    I see that getsubids <user> works on my Fedora 36, even though I don't think I enabled centralized subid support in FreeIPA. I don't see subid: sss in my /etc/nsswitch.conf.

    So, I suppose we should first check getsubids <user>. In case the getsubids binary is absent, we can fallback to the directly checking the files. Did I get that right?

  3. mhjacks commented on Aug 6, 2022

    @mhjacks
    Author

    Yes, I think changing the test to use getsubids is an ideal approach - that binary should be present with any version of shadow that supports this scheme. And if the binary is absent, checking the files is as good an approach as any.

  4. changed the title [-]Should toolbox switch to new idMapping mechanism for mapping subids?[/-] [+]Support subordinate user and group IDs provided by SSSD on enterprise FreeIPA set-ups[/+] on Nov 30, 2022
  5. debarshiray commented on Nov 30, 2022

    @debarshiray
    Member

    Updated the title of this issue, because @mhjacks has gotten this to work in #1180

  6. debarshiray commented on Jan 28, 2023

    @debarshiray
    Member

    This was fixed in #1180 (and #1219).

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

    1. Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions