</term>
<listitem>
<para>
- This field will be encrypted and used as the new value of the
- encrypted password.
+ If this field is not empty,
+ it will be encrypted
+ and used as the new value of the encrypted password.
</para>
</listitem>
</varlistentry>
usernames[nusers-1] = xstrdup(fields[0]);
passwords[nusers-1] = xstrdup(fields[1]);
#endif /* USE_PAM */
- if (add_passwd (&newpw, fields[1]) != 0) {
+ if (!streq(fields[1], "") && add_passwd(&newpw, fields[1]) != 0) {
fprintf (stderr,
_("%s: line %jd: can't update password\n"),
Prog, line);
#ifdef USE_PAM
/* Now update the passwords using PAM */
for (size_t i = 0; i < nusers; i++) {
+ if (streq(passwords[i], ""))
+ continue;
if (do_pam_passwd_non_interactive ("newusers", usernames[i], passwords[i]) != 0) {
fprintf (stderr,
_("%s: (line %jd, user %s) password not changed\n"),