lib: replace USER_NAME_MAX_LENGTH macro
Replace it by `sysconf(_SC_LOGIN_NAME_MAX)`, which is the maximum username length supported by the kernel. Resolves: https://github.com/shadow-maint/shadow/issues/674 Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
This commit is contained in:
committed by
Serge Hallyn
parent
fb8f44d73f
commit
3b7cc05387
+2
-3
@@ -75,10 +75,9 @@ static bool is_valid_name (const char *name)
|
||||
bool is_valid_user_name (const char *name)
|
||||
{
|
||||
/*
|
||||
* User names are limited by whatever utmp can
|
||||
* handle.
|
||||
* User names length are limited by the kernel
|
||||
*/
|
||||
if (strlen (name) > USER_NAME_MAX_LENGTH) {
|
||||
if (strlen (name) > sysconf(_SC_LOGIN_NAME_MAX)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user