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:
Iker Pedrosa
2023-07-19 12:05:09 +02:00
committed by Serge Hallyn
parent fb8f44d73f
commit 3b7cc05387
3 changed files with 10 additions and 13 deletions
-4
View File
@@ -232,10 +232,6 @@ static inline void memzero(void *ptr, size_t size)
# define format_attr(type, index, check)
#endif
/* Maximum length of usernames */
#include <utmp.h>
#define USER_NAME_MAX_LENGTH (sizeof (((struct utmp *)NULL)->ut_user))
/* Maximum length of passwd entry */
#define PASSWD_ENTRY_MAX_LENGTH 32768