Package: adduser
Severity: important
Version: 3.137
X-Debbugs-Cc: [email protected]

Dear Maintainer(s),

Filing on request from Chris.

One of my autopkgtest started failing in unstable since the last shadow
upload. All it does is calling a nested autopkgtest, which attempts to
create a 'test' user inside an LXD container and fails with:

chfn: invalid name: ',,'

Full log:

1483s autopkgtest [03:35:02]: version 5.44
1483s autopkgtest [03:35:02]: host host; command line: /usr/bin/autopkgtest -U 
-B . --test-name=unit-tests --test-name=boot-and-services -- lxd 
autopkgtest/debian/sid/amd64
1490s info: Adding user `test' ...
1490s info: Selecting UID/GID from range 1000 to 59999 ...
1490s info: Adding new group `test' (1000) ...
1490s info: Adding new user `test' (1000) with group `test (1000)' ...
1490s info: Creating home directory `/home/test' ...
1490s info: Copying files from `/etc/skel' ...
1490s chfn: invalid name: ',,'
1490s fatal: `/bin/chfn -w  test' returned error code 1. Exiting.
1492s autopkgtest [03:35:12]: ERROR: "sh -euc #!/bin/sh
1492s # Copyright 2022 Simon McVittie
1492s # SPDX-License-Identifier: GPL-2.0-or-later
1492s
1492s # create-normal-user [USERNAME]
1492s # Create an ordinary, unprivileged user.
1492s
1492s set -eu
1492s
1492s usage () {
1492s     echo "Usage: create-normal-user [USERNAME]" >&2
1492s     exit 2
1492s }
1492s
1492s create () {
1492s     # shellcheck disable=SC3043
1492s     local user="$1"
1492s     shift
1492s
1492s     if command -v adduser >/dev/null; then
1492s         adduser \
1492s             --disabled-login \
1492s             --gecos 'Temporary autopkgtest user,,,' \
1492s             "$user" 2>&1
1492s     elif command -v useradd >/dev/null; then
1492s         useradd \
1492s             --comment 'Temporary autopkgtest user' \
1492s             --create-home \
1492s             --expiredate '' \
1492s             --user-group \
1492s             "$user" 2>&1
1492s     else
1492s         echo "Neither adduser nor useradd is installed" >&2
1492s         return 1
1492s     fi
1492s
1492s     echo "$user" > /run/autopkgtest-normal-user
1492s }
1492s
1492s case "${1-}" in
1492s     (--)
1492s         shift
1492s         ;;
1492s
1492s     (-*)
1492s         usage
1492s         ;;
1492s esac
1492s
1492s if [ "$#" -gt 1 ]; then
1492s     usage
1492s fi
1492s
1492s if [ "$#" -eq 1 ]; then
1492s     create "$1"
1492s     exit 0
1492s fi
1492s
1492s tries=20
1492s
1492s for i in $(seq 0 "$tries"); do
1492s     if [ "$i" = 0 ]; then
1492s         user="test"
1492s     else
1492s         random=$(mktemp /tmp/test-XXXXXX)
1492s         user="$(basename "$random")"
1492s         rm -f "$random"
1492s     fi
1492s
1492s     if getent passwd "$user" >/dev/null; then
1492s         echo "create-normal-user: '$user' already exists"
1492s     else
1492s         create "$user"
1492s         exit 0
1492s     fi
1492s done
1492s
1492s echo "create-normal-user: Unable to generate a new username (tried $tries 
times)" >&2
1492s exit 1
1492s " failed with status 82

https://ci.debian.net/packages/s/systemd/unstable/amd64/57888006/#S55

Reply via email to