mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
userdb: allow dots in username
This prevents an error in pam_systemd when logging in. sshd[2623165]: pam_unix(sshd:session): session opened for user tony.stark(uid=10001) by (uid=0) sshd[2623165]: pam_systemd(sshd:session): Failed to get user record: Invalid argument Bug: https://bugs.gentoo.org/708824
This commit is contained in:
parent
2a5180945a
commit
19bb96759a
@ -4107,7 +4107,7 @@ int json_dispatch_user_group_name(const char *name, JsonVariant *variant, JsonDi
|
||||
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a string.", strna(name));
|
||||
|
||||
n = json_variant_string(variant);
|
||||
if (!valid_user_group_name(n))
|
||||
if (!valid_user_group_name_compat(n))
|
||||
return json_log(variant, flags, SYNTHETIC_ERRNO(EINVAL), "JSON field '%s' is not a valid user/group name.", strna(name));
|
||||
|
||||
r = free_and_strdup(s, n);
|
||||
|
@ -600,7 +600,7 @@ int json_dispatch_user_group_list(const char *name, JsonVariant *variant, JsonDi
|
||||
if (!json_variant_is_string(e))
|
||||
return json_log(e, flags, SYNTHETIC_ERRNO(EINVAL), "JSON array element is not a string.");
|
||||
|
||||
if (!valid_user_group_name(json_variant_string(e)))
|
||||
if (!valid_user_group_name_compat(json_variant_string(e)))
|
||||
return json_log(e, flags, SYNTHETIC_ERRNO(EINVAL), "JSON array element is not a valid user/group name: %s", json_variant_string(e));
|
||||
|
||||
r = strv_extend(&l, json_variant_string(e));
|
||||
|
@ -587,7 +587,7 @@ int userdb_by_name(const char *name, UserDBFlags flags, UserRecord **ret) {
|
||||
_cleanup_(json_variant_unrefp) JsonVariant *query = NULL;
|
||||
int r;
|
||||
|
||||
if (!valid_user_group_name(name))
|
||||
if (!valid_user_group_name_compat(name))
|
||||
return -EINVAL;
|
||||
|
||||
r = json_build(&query, JSON_BUILD_OBJECT(
|
||||
@ -797,7 +797,7 @@ int groupdb_by_name(const char *name, UserDBFlags flags, GroupRecord **ret) {
|
||||
_cleanup_(json_variant_unrefp) JsonVariant *query = NULL;
|
||||
int r;
|
||||
|
||||
if (!valid_user_group_name(name))
|
||||
if (!valid_user_group_name_compat(name))
|
||||
return -EINVAL;
|
||||
|
||||
r = json_build(&query, JSON_BUILD_OBJECT(
|
||||
@ -990,7 +990,7 @@ int membershipdb_by_user(const char *name, UserDBFlags flags, UserDBIterator **r
|
||||
|
||||
assert(ret);
|
||||
|
||||
if (!valid_user_group_name(name))
|
||||
if (!valid_user_group_name_compat(name))
|
||||
return -EINVAL;
|
||||
|
||||
r = json_build(&query, JSON_BUILD_OBJECT(
|
||||
@ -1033,7 +1033,7 @@ int membershipdb_by_group(const char *name, UserDBFlags flags, UserDBIterator **
|
||||
|
||||
assert(ret);
|
||||
|
||||
if (!valid_user_group_name(name))
|
||||
if (!valid_user_group_name_compat(name))
|
||||
return -EINVAL;
|
||||
|
||||
r = json_build(&query, JSON_BUILD_OBJECT(
|
||||
|
Loading…
Reference in New Issue
Block a user