projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
932ad62
)
sysusers: don't allow control characters in gecos fields
author
Lennart Poettering
<lennart@poettering.net>
Wed, 9 Jul 2014 17:21:42 +0000
(19:21 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 9 Jul 2014 17:22:13 +0000
(19:22 +0200)
src/sysusers/sysusers.c
patch
|
blob
|
history
diff --git
a/src/sysusers/sysusers.c
b/src/sysusers/sysusers.c
index
40a6697
..
129493a
100644
(file)
--- a/
src/sysusers/sysusers.c
+++ b/
src/sysusers/sysusers.c
@@
-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;