From: nekral-guest Date: Sat, 9 May 2009 13:14:31 +0000 (+0000) Subject: * src/passwd.c: Exit immediately when unlocking a password would X-Git-Tag: 4.1.4~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61939960cc4b93f6c47fa381495ddd15ce179712;p=shadow * src/passwd.c: Exit immediately when unlocking a password would result in a passwordless account. This avoid printing a success message after the warning. --- diff --git a/ChangeLog b/ChangeLog index 37e37eab..aba117e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-07 Nicolas François + + * src/passwd.c: Exit immediately when unlocking a password would + result in a passwordless account. This avoid printing a success + message after the warning. + 2009-05-07 Nicolas François * src/nologin.c: Include to get EXIT_FAILURE. diff --git a/src/passwd.c b/src/passwd.c index cda99885..58b69dc1 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -519,9 +519,10 @@ static char *update_crypt_pw (char *cp) if (uflg && *cp == '!') { if (cp[1] == '\0') { fprintf (stderr, - _("%s: unlocking the password would result in a passwordless account.\n" - "You should set a password with usermod -p to unlock the password of this account.\n"), - Prog); + _("%s: unlocking the password would result in a passwordless account.\n" + "You should set a password with usermod -p to unlock the password of this account.\n"), + Prog); + fail_exit (E_FAILURE); } else { cp++; }