src/: Fix long/time_t handling

Special care has to be taken for 32 bit systems with a 64 bit time_t,
since their long data type is still 32 bit.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: <https://github.com/shadow-maint/shadow/pull/876>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Tobias Stoeckmann
2024-01-05 15:41:12 -06:00
committed by Serge Hallyn
parent 2d188a9987
commit 1a383194ff
+1 -1
View File
@@ -816,7 +816,7 @@ static void check_spw_file (int *errors, bool *changed)
if (!quiet) {
time_t t = time (NULL);
if ( (t != 0)
&& (spw->sp_lstchg > (long) t / DAY)) {
&& (spw->sp_lstchg > t / DAY)) {
printf (_("user %s: last password change in the future\n"),
spw->sp_namp);
*errors += 1;