mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-04 07:48:36 +00:00
sysusers: don't allow control characters in gecos fields
This commit is contained in:
@@ -1107,7 +1107,11 @@ static bool valid_gecos(const char *d) {
|
||||
if (!utf8_is_valid(d))
|
||||
return false;
|
||||
|
||||
if (strpbrk(d, ":\n"))
|
||||
if (string_has_cc(d, NULL))
|
||||
return false;
|
||||
|
||||
/* Colons are used as field separators, and hence not OK */
|
||||
if (strchr(d, ':'))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user