sysusers: don't allow control characters in gecos fields

(cherry picked from commit 38c74dad1c)
This commit is contained in:
Lennart Poettering
2014-07-19 14:28:46 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent e17ff7ab51
commit b374a6f621
+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;