Package: adduser
Version: 3.128

I get the following error when first adding a group and then trying
to add a user with this group:

# addgroup --gid 2000 build
# adduser --uid 2000 --gid 2000 --home /build --gecos "" --disabled-password 
build
Adding user `build' ...
Use of uninitialized value $grname in printf at /usr/sbin/adduser line 625.
Adding new user `build' (2000) with group ` (-1)' ...
useradd: group '-1' does not exist
adduser: `/sbin/useradd -d /build -g -1 -s /bin/bash -u 2000 build' returned 
error code 6. Exiting.

The group appears to have been added successfully:

# getent group 2000
build:x:2000:

Also, the same command but which uses --ingroup instead of --gid
succeeds:

# adduser --uid 2000 --ingroup build --home /build --gecos "" 
--disabled-password build
Adding user `build' ...
Adding new user `build' (2000) with group `build (2000)' ...
Creating home directory `/build' ...
Copying files from `/etc/skel' ...
Adding new user `build' to supplemental / extra groups `users' ...
Adding user `build' to group `users' ...

I tried to look around in the adduser Perl script but couldn't see
anything obvious. This is using Debian testing (bookworm) and I see
that the adduser package hasn't changed since stable (bullseye) and
I definitely tried the same with an earlier snapshot of testing so
the issue is probable not in the script itself. Maybe in one of the
Perl modules?

Also, for completeness, this is running under systemd-nspawn -D --boot.
Let me know if you need me to run any tests in this environment. I have
it readily available.

Reply via email to