confd: disable password aging when unlocking password login for user

We cannot rely on time being correct.  Password expiration need to be handled
by external mechanism, e.g., RADIUS.

Fixes #534

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-08-08 13:35:27 +02:00
parent 12d969ab0c
commit c3a4a93cc8
+10
View File
@@ -984,6 +984,16 @@ static int set_password(const char *user, const char *hash, bool lock)
if (!strcmp(sp->sp_namp, user)) {
usp = *sp;
usp.sp_pwdp = lock ? "!" : (char *)hash;
/*
* Disable password aging & C:o, we cannot rely
* on time being correct.
*/
usp.sp_lstchg = -1;
usp.sp_min = -1;
usp.sp_max = -1;
usp.sp_warn = -1;
usp.sp_inact = -1;
usp.sp_expire = -1;
sp = &usp;
}