mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 15:47:59 +02:00
CI: Make user creation idempotent
adduser --system exits successfully if the user already exists, but ordinary adduser doesn't. Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/468 Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
b230cf03b0
commit
8d14293458
1 changed files with 3 additions and 1 deletions
|
|
@ -173,7 +173,9 @@ case "$ci_distro" in
|
|||
if [ "$ci_in_docker" = yes ]; then
|
||||
# Add the user that we will use to do the build inside the
|
||||
# Docker container, and let them use sudo
|
||||
adduser --disabled-password --gecos "" user
|
||||
if ! getent passwd user > /dev/null; then
|
||||
adduser --disabled-password --gecos "" user
|
||||
fi
|
||||
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopasswd
|
||||
chmod 0440 /etc/sudoers.d/nopasswd
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue