* 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:
@@ -65,6 +65,11 @@ struct spwd *pwd_to_spwd (const struct passwd *pw)
|
||||
sp.sp_min = 0;
|
||||
sp.sp_max = (10000L * DAY) / SCALE;
|
||||
sp.sp_lstchg = (long) time ((time_t *) 0) / SCALE;
|
||||
if (0 == sp.sp_lstchg) {
|
||||
/* Better disable aging than requiring a password
|
||||
* change */
|
||||
sp.sp_lstchg = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user