Commit 980ed460 authored by Michael Catanzaro's avatar Michael Catanzaro

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
parent d0d10dac
Pipeline #113985 passed with stage
in 58 seconds
...@@ -893,6 +893,11 @@ user_set_real_name (AccountsUser *auser, ...@@ -893,6 +893,11 @@ user_set_real_name (AccountsUser *auser,
return TRUE; 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) if (accounts_user_get_uid (ACCOUNTS_USER (user)) == (uid_t) uid)
action_id = "org.freedesktop.accounts.change-own-user-data"; action_id = "org.freedesktop.accounts.change-own-user-data";
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment