]> git.ipfire.org Git - thirdparty/shadow.git/commit
src/passwd.c: Switch to day precision
authorTobias Stoeckmann <tobias@stoeckmann.org>
Thu, 14 Dec 2023 10:54:00 +0000 (11:54 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 5 Jan 2024 21:41:12 +0000 (15:41 -0600)
commit3b5ba41d3e9dfc3bf058f0f31529c08201265241
treee2a4933819014aee2b520b211c7045b222225178
parentecc3508877d254bbdc4579cf8f08c07697a578c9
src/passwd.c: Switch to day precision

The size of time_t varies across systems, but since data type long is
more than enough to calculate with days (precision of shadow file),
use it instead.

Just in case a shadow file contains huge values, check for a possible
signed integer overflow.

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>
src/passwd.c