summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-01-05 12:39:28 +0100
committerLennart Poettering <lennart@poettering.net>2024-01-05 12:43:06 +0100
commitf0e4244b2fda1b3de3da1c2792ed1cd21c72087b (patch)
tree648cf848ac06afc46f809f33d929954136c9001d /src/shared
parentjson: add new dispatch flag JSON_ALLOW_EXTENSIONS (diff)
downloadsystemd-f0e4244b2fda1b3de3da1c2792ed1cd21c72087b.tar.xz
systemd-f0e4244b2fda1b3de3da1c2792ed1cd21c72087b.zip
tree-wide: use JSON_ALLOW_EXTENSIONS when disptching at various places
If we want to allow method replies to be extended without this breaking compat, then we should set this flag. Do so at various method call replies hence. Also do it when parsing user/group records, which are expressly documented to be extensible, as well as the hibernate JSON record.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/group-record.c2
-rw-r--r--src/shared/user-record.c2
-rw-r--r--src/shared/userdb.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/shared/group-record.c b/src/shared/group-record.c
index 1e33bdfed5..4fed5c671c 100644
--- a/src/shared/group-record.c
+++ b/src/shared/group-record.c
@@ -230,7 +230,7 @@ int group_record_load(
if (r < 0)
return r;
- r = json_dispatch(h->json, group_dispatch_table, json_flags, h);
+ r = json_dispatch(h->json, group_dispatch_table, json_flags | JSON_ALLOW_EXTENSIONS, h);
if (r < 0)
return r;
diff --git a/src/shared/user-record.c b/src/shared/user-record.c
index 3fe3e80b83..035e2a7124 100644
--- a/src/shared/user-record.c
+++ b/src/shared/user-record.c
@@ -1625,7 +1625,7 @@ int user_record_load(UserRecord *h, JsonVariant *v, UserRecordLoadFlags load_fla
if (r < 0)
return r;
- r = json_dispatch(h->json, user_dispatch_table, json_flags, h);
+ r = json_dispatch(h->json, user_dispatch_table, json_flags | JSON_ALLOW_EXTENSIONS, h);
if (r < 0)
return r;
diff --git a/src/shared/userdb.c b/src/shared/userdb.c
index f60d48ace4..540573390c 100644
--- a/src/shared/userdb.c
+++ b/src/shared/userdb.c
@@ -199,7 +199,7 @@ static int userdb_on_query_reply(
assert_se(!iterator->found_user);
- r = json_dispatch(parameters, dispatch_table, 0, &user_data);
+ r = json_dispatch(parameters, dispatch_table, JSON_ALLOW_EXTENSIONS, &user_data);
if (r < 0)
goto finish;
@@ -256,7 +256,7 @@ static int userdb_on_query_reply(
assert_se(!iterator->found_group);
- r = json_dispatch(parameters, dispatch_table, 0, &group_data);
+ r = json_dispatch(parameters, dispatch_table, JSON_ALLOW_EXTENSIONS, &group_data);
if (r < 0)
goto finish;
@@ -309,7 +309,7 @@ static int userdb_on_query_reply(
assert(!iterator->found_user_name);
assert(!iterator->found_group_name);
- r = json_dispatch(parameters, dispatch_table, 0, &membership_data);
+ r = json_dispatch(parameters, dispatch_table, JSON_ALLOW_EXTENSIONS, &membership_data);
if (r < 0)
goto finish;