Skip to content

os/user: Fails to return correct user names when users defined outside /etc/passwd #70276

@tzugen

Description

@tzugen

Go version

1.23.3

Output of go env in your module/workspace:

N/A

What did you do?

Use lookupUserId() to retrieve the username for a given id on Fedora Silverblue.

Internally os/user looks hardcoded in /etc/passwd , which does not contain the system users in Fedora Silverblue. Instead the /etc/nsswitch.conf should be queried to retrieve places in which users are defined and then proceeded from there. This call will also not report the correct name for users defined through ldap etc.

What did you see happen?

UnknownUserIdError

What did you expect to see?

A valid username

Metadata

Metadata

Assignees

No one assigned

    Labels

    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions