1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-05 13:18:06 +03:00

user-util: add comments explaining what the user name size limits effectively mean

This commit is contained in:
Lennart Poettering 2024-01-24 22:39:33 +01:00
parent ac0054e686
commit b009782b5d

View File

@ -797,11 +797,11 @@ bool valid_user_group_name(const char *u, ValidUserFlags flags) {
sz = sysconf(_SC_LOGIN_NAME_MAX);
assert_se(sz > 0);
if (l > (size_t) sz)
if (l > (size_t) sz) /* glibc: 256 */
return false;
if (l > NAME_MAX) /* must fit in a filename */
if (l > NAME_MAX) /* must fit in a filename: 255 */
return false;
if (l > UT_NAMESIZE - 1)
if (l > UT_NAMESIZE - 1) /* must fit in utmp: 31 */
return false;
}