* libmisc/pwd2spwd.c, src/chpasswd.c, src/newusers.c,

src/passwd.c, src/pwck.c, src/pwconv.c, src/useradd.c,
	src/usermod.c: On Jan 01, 1970, do not set the sp_lstchg field to
	0 (which means that the password shall be changed during the next
	login), but use -1 (password aging disabled).
	* src/passwd.c: Do not check sp_min if sp_lstchg is null or -1.
This commit is contained in:
nekral-guest
2009-04-05 21:23:27 +00:00
parent 7585fa0fe9
commit b23443630c
9 changed files with 69 additions and 18 deletions

View File

@ -203,6 +203,11 @@ int main (int argc, char **argv)
}
spent.sp_pwdp = pw->pw_passwd;
spent.sp_lstchg = (long) time ((time_t *) 0) / SCALE;
if (0 == spent.sp_lstchg) {
/* Better disable aging than requiring a password
* change */
spent.sp_lstchg = -1;
}
if (spw_update (&spent) == 0) {
fprintf (stderr,
_("%s: failed to prepare the new %s entry '%s'\n"),