summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2025-08-12 15:31:25 +0000
committerFelix Fietkau2025-08-12 15:31:26 +0000
commitdafdf98b03bfa6014cd94ffc86de130b9deb17e4 (patch)
tree9005128c6b547b4dd4a26027a64e615d02696bd7
parent46780098002167070c665f03f1a8ed76d1e1c55f (diff)
downloadprocd-dafdf98b03bfa6014cd94ffc86de130b9deb17e4.tar.gz
service: fix object nesting in the ubus get_data call
Depending on the contents, instance sub-objects can be confused with per-service data items. Fix the nesting by making an instance object for service items. Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--service/service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/service/service.c b/service/service.c
index 515c992..4070e74 100644
--- a/service/service.c
+++ b/service/service.c
@@ -838,10 +838,15 @@ service_get_data(struct ubus_context *ctx, struct ubus_object *obj,
if (!cs)
cs = blobmsg_open_table(&b, s->name);
+ if (!ci)
+ ci = blobmsg_open_table(&b, "*");
blobmsg_add_blob(&b, var->data);
}
+ if (ci)
+ blobmsg_close_table(&b, ci);
+
vlist_for_each_element(&s->instances, in, node) {
ci = NULL;