sysusers: don't allow control characters in gecos fields

This commit is contained in:
Lennart Poettering
2014-07-09 19:22:13 +02:00
parent 932ad62b84
commit 38c74dad1c
+5 -1
View File
@@ -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;