]> granicus.if.org Git - shadow/commitdiff
* src/passwd.c: Exit immediately when unlocking a password would
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 9 May 2009 13:14:31 +0000 (13:14 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 9 May 2009 13:14:31 +0000 (13:14 +0000)
result in a passwordless account. This avoid printing a success
message after the warning.

ChangeLog
src/passwd.c

index 37e37eabb302498aa53efc6eb35d89c0fa32e164..aba117e870dd00bf16ca3b989e233aed8a8708f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-07  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * 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  <nicolas.francois@centraliens.net>
 
        * src/nologin.c: Include <stdlib.h> to get EXIT_FAILURE.
index cda99885134591b35508929a42ec7d597b86820b..58b69dc1fbca4b409c75348247126f92ef605740 100644 (file)
@@ -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++;
                }