Align sysusers-generated shell value with upstream systemd default

rhel-only

Resolves: #2217149
This commit is contained in:
Luca BRUNO 2022-08-09 12:55:20 +02:00 committed by Christian Glombek
parent 1a82a5d221
commit 83d62beefc

View File

@ -14,7 +14,7 @@ user() {
[ "$desc" = '-' ] && desc=
{ [ "$home" = '-' ] || [ "$home" = '' ]; } && home=/
{ [ "$shell" = '-' ] || [ "$shell" = '' ]; } && shell=/sbin/nologin
{ [ "$shell" = '-' ] || [ "$shell" = '' ]; } && shell=/usr/sbin/nologin
if [ "$uid" = '-' ] || [ "$uid" = '' ]; then
cat <<EOF
@ -25,9 +25,9 @@ EOF
cat <<EOF
if ! getent passwd '$user' >/dev/null; then
if ! getent passwd '$uid' >/dev/null; then
useradd -r -u '$uid' -g '$group' -d '$home' -s /sbin/nologin -c '$desc' '$user' || :
useradd -r -u '$uid' -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
else
useradd -r -g '$group' -d '$home' -s /sbin/nologin -c '$desc' '$user' || :
useradd -r -g '$group' -d '$home' -s '$shell' -c '$desc' '$user' || :
fi
fi