return bus_append_byte_array(m, field, roothash_sig_decoded, roothash_sig_decoded_size);
}
+static int bus_append_root_image_options(sd_bus_message *m, const char *field, const char *eq) {
+ _cleanup_strv_free_ char **l = NULL;
+ const char *p = eq;
+ int r;
+
+ r = sd_bus_message_open_container(m, SD_BUS_TYPE_STRUCT, "sv");
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, field);
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_open_container(m, 'v', "a(ss)");
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_open_container(m, 'a', "(ss)");
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = strv_split_colon_pairs(&l, p);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse argument: %m");
+
+ STRV_FOREACH_PAIR(first, second, l) {
+ r = sd_bus_message_append(m, "(ss)",
+ !isempty(*second) ? *first : "root",
+ !isempty(*second) ? *second : *first);
+ if (r < 0)
+ return bus_log_create_error(r);
+ }
+
+ r = sd_bus_message_close_container(m);
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_close_container(m);
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ r = sd_bus_message_close_container(m);
+ if (r < 0)
+ return bus_log_create_error(r);
+
+ return 1;
+}
+
static int bus_append_cgroup_property(sd_bus_message *m, const char *field, const char *eq) {
if (STR_IN_SET(field, "DevicePolicy",
"Slice",
if (streq(field, "RootHashSignature"))
return bus_append_root_hash_signature(m, field, eq);
- if (streq(field, "RootImageOptions")) {
- _cleanup_strv_free_ char **l = NULL;
- const char *p = eq;
-
- r = sd_bus_message_open_container(m, SD_BUS_TYPE_STRUCT, "sv");
- if (r < 0)
- return bus_log_create_error(r);
-
- r = sd_bus_message_append_basic(m, SD_BUS_TYPE_STRING, field);
- if (r < 0)
- return bus_log_create_error(r);
-
- r = sd_bus_message_open_container(m, 'v', "a(ss)");
- if (r < 0)
- return bus_log_create_error(r);
-
- r = sd_bus_message_open_container(m, 'a', "(ss)");
- if (r < 0)
- return bus_log_create_error(r);
-
- r = strv_split_colon_pairs(&l, p);
- if (r < 0)
- return log_error_errno(r, "Failed to parse argument: %m");
-
- STRV_FOREACH_PAIR(first, second, l) {
- r = sd_bus_message_append(m, "(ss)",
- !isempty(*second) ? *first : "root",
- !isempty(*second) ? *second : *first);
- if (r < 0)
- return bus_log_create_error(r);
- }
-
- r = sd_bus_message_close_container(m);
- if (r < 0)
- return bus_log_create_error(r);
-
- r = sd_bus_message_close_container(m);
- if (r < 0)
- return bus_log_create_error(r);
-
- r = sd_bus_message_close_container(m);
- if (r < 0)
- return bus_log_create_error(r);
-
- return 1;
- }
+ if (streq(field, "RootImageOptions"))
+ return bus_append_root_image_options(m, field, eq);
if (streq(field, "MountImages")) {
const char *p = eq;