Tobias Stoeckmann
dbdda2a48a
lib/: Saturate addition to avoid overflow
...
Very large values in /etc/shadow could lead to overflows. Make sure
that these calculations are saturated at LONG_MAX. Since entries are
based on days and not seconds since epoch, saturating won't hurt anyone.
Co-developed-by: Tobias Stoeckmann <tobias@stoeckmann.org >
Co-developed-by: Alejandro Colomar <alx@kernel.org >
Signed-off-by: Alejandro Colomar <alx@kernel.org >
Cherry-picked-from: 674409e226 ("lib/: Saturate addition to avoid overflow")
Cc: "Serge E. Hallyn" <serge@hallyn.com >
Link: <https://github.com/shadow-maint/shadow/pull/876 >
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2024-02-14 04:08:26 +01:00
Tobias Stoeckmann
55f9635ecf
lib/, src/: Remove SCALE definition
...
SCALE is always DAY (and has to be always DAY), so replace it with DAY
in source code and remove unneeded calculations.
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 >
Cherry-picked-from: ecc3508877 ("lib/, src/: Remove SCALE definition")
Cc: "Serge E. Hallyn" <serge@hallyn.com >
Link: <https://github.com/shadow-maint/shadow/pull/888 >
Link: <https://github.com/shadow-maint/shadow/pull/876 >
[alx: This is a pre-requisite for 674409e226 ("lib/: Saturate addition to avoid overflow")]
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2024-02-14 04:07:32 +01:00
Alejandro Colomar
0004cc46dd
lib: Merge libmisc into libshadow
...
The separation was unnecessary, and caused build problems. Let's go
wild and obliterate the library. The files are moved to libshadow.
Scripted change:
$ find libmisc/ -type f \
| grep '\.[chy]$' \
| xargs mv -t lib;
Plus updating the Makefile and other references. While at it, I've
sorted the sources lists.
Link: <https://github.com/shadow-maint/shadow/pull/792 >
Reported-by: David Seifert <soap@gentoo.org >
Cc: Sam James <sam@gentoo.org >
Cc: Christian Bricart <christian@bricart.de >
Cc: Michael Vetter <jubalh@iodoru.org >
Cc: Robert Förster <Dessa@gmake.de >
[ soap tested the Gentoo package ]
Tested-by: David Seifert <soap@gentoo.org >
Acked-by: David Seifert <soap@gentoo.org >
Acked-by: Serge Hallyn <serge@hallyn.com >
Acked-by: Iker Pedrosa <ipedrosa@redhat.com >
Acked-by: <lslebodn@fedoraproject.org >
Signed-off-by: Alejandro Colomar <alx@kernel.org >
2023-09-10 14:13:01 +02:00