mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-26 08:55:18 +03:00
userdb: Use json_dispatch_user_group_name() to parse GetMembership fields
It allows to relax the checks and allow characters like '\', used by windows to split the domain name and user name. For reference, discussion in the systemd-devel mailing list: https://lists.freedesktop.org/archives/systemd-devel/2023-February/048804.html Signed-off-by: Samuel Cabrero <scabrero@suse.de> (cherry picked from commitedd5ec2373
) (cherry picked from commit68d11465e4
) (cherry picked from commit132e153b90
)
This commit is contained in:
parent
3271bc9bec
commit
dde473ed45
@ -296,8 +296,8 @@ static int userdb_on_query_reply(
|
||||
} membership_data = {};
|
||||
|
||||
static const JsonDispatch dispatch_table[] = {
|
||||
{ "userName", JSON_VARIANT_STRING, json_dispatch_const_string, offsetof(struct membership_data, user_name), JSON_SAFE },
|
||||
{ "groupName", JSON_VARIANT_STRING, json_dispatch_const_string, offsetof(struct membership_data, group_name), JSON_SAFE },
|
||||
{ "userName", JSON_VARIANT_STRING, json_dispatch_user_group_name, offsetof(struct membership_data, user_name), JSON_RELAX },
|
||||
{ "groupName", JSON_VARIANT_STRING, json_dispatch_user_group_name, offsetof(struct membership_data, group_name), JSON_RELAX },
|
||||
{}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user