Skip to content

id returns wrong exit code when user does not exist #12246

@peter-englmaier

Description

@peter-englmaier

We noticed, that id return exit code 1, when user is not found. This can happen inside docker and can cause startup scripts to fail. Please revert to the old behavior.

This is what happens with the uutils version (i.e. with docker image ubuntu:latest):

root@ea03ae12c436:/# id
id: cannot find name for group ID 1234
id: cannot find name for group ID 1234
uid=0(root) gid=1234(1234) groups=1234(1234)
root@ea03ae12c436:/# echo $?
1

And this was the old behavior (i.e. with docker image ubuntu:noble):

root@a0d7473d7858:/# id
uid=0(root) gid=1234 groups=1234
root@a0d7473d7858:/# echo $?
0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions