#1124950 usermod -U on a passwordless account returns with exit code 0

Package:
passwd
Source:
passwd
Description:
change and administer password and group data
Submitter:
Marc Haber
Date:
2026-01-15 17:53:02 UTC
Severity:
normal
Tags:
#1124950#5
Date:
2026-01-07 18:00:46 UTC
From:
To:
Hi,

# useradd foo
# usermod -U foo
usermod: unlocking the user's password would result in a passwordless account.
You should set a password with usermod -p to unlock this user's password.
# echo $?
0
#

usermod should not exit with a zero return code in this situation.

Greetings
Marc