Bug 15616 - adduser shows uid '200' in use when the gid is in use
Summary: adduser shows uid '200' in use when the gid is in use
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-02 08:34 UTC by Sven Kirmess
Modified: 2023-06-02 08:34 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Kirmess 2023-06-02 08:34:22 UTC
adduser incorrectly reports the uid 200 to be already in use - the actual problem is that it tries to create a group with gid 200 and the gid is already in use.
The error message should read "adduser: gid '200' in use" or maybe even "adduser: gid '200' in use by group nofiles" to make it clear what the problem is.

$ docker run --rm -it alpine sh
/ # adduser -u 200 test
adduser: uid '200' in use
/ # grep 200 /etc/passwd /etc/group
/etc/group:nofiles:x:200:
/ # adduser -u 200 -G nofiles -D test


https://gitlab.alpinelinux.org/alpine/aports/-/issues/14954