diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2020-02-26 17:21:07 -0600 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2020-02-28 10:22:04 -0600 |
commit | 980ed4604cdc57af5befabc13bfdbd9d9bb233eb (patch) | |
tree | 271cbb40ad208af5c8fe14878a935540f05a78e0 /src | |
parent | d0d10dac1dc7bff16d1cdff67466029cb10687f9 (diff) |
user: reject requests to change full name to something including a comma
Because real name is stored in the GECOS field of /etc/passwd, which is delimited
by commas that cannot be escaped, the user's full name must not contain a comma.
Fixes #83
Diffstat (limited to 'src')
-rw-r--r-- | src/user.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -893,6 +893,11 @@ user_set_real_name (AccountsUser *auser, return TRUE; } + if (g_utf8_strchr (real_name, -1, ',') != NULL) { + throw_error (context, ERROR_FAILED, "setting real name failed: real name '%s' must not contain commas", real_name); + return TRUE; + } + if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid) action_id = "org.freedesktop.accounts.change-own-user-data"; else |