Fixes: 10396f953613 ("* libmisc/limits.c: Parse the limits, umask, nice, maxlogin, file limit with getlog() / getulong().")
Link: <https://github.com/shadow-maint/shadow/pull/893/commits/
882cf59459bc4501b0882a7f02d36c8ce28a30f2>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
unsigned long limit, count;
if (str2ul(&limit, maxlogins) == -1) {
+ if (errno == ERANGE) {
+ SYSLOG((LOG_WARN, "Invalid maxlogins value\n"));
+ return LOGIN_ERROR_LOGIN;
+ }
return 0;
}