From: Felix Fietkau Date: Tue, 12 Aug 2025 15:31:25 +0000 (+0200) Subject: service: fix object nesting in the ubus get_data call X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=dafdf98b03bfa6014cd94ffc86de130b9deb17e4;p=project%2Fprocd.git 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 --- 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;