summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-09-12 15:36:14 +0200
committerJo-Philipp Wich <jo@mein.io>2022-09-12 15:36:14 +0200
commite80d0b2d77f8ed163872971200d24c423db60bb8 (patch)
tree19b136fa068350c16ca7299403d571fca0b789dc
parent0d022430861abfa84913936929f606671efddc8b (diff)
downloadrpcd-e80d0b2d77f8ed163872971200d24c423db60bb8.tar.gz
ucode: pass-through `ubus_rpc_session` argument
Allow the special `ubus_rpc_session` method call argument even if it is not specified in the policy. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--ucode.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ucode.c b/ucode.c
index bc07047..e0a7937 100644
--- a/ucode.c
+++ b/ucode.c
@@ -304,8 +304,13 @@ rpc_ucode_validate_call_args(struct ubus_object *obj, const char *ubus_method_na
}
/* named argument not found in policy */
- if (!found)
+ if (!found) {
+ /* allow special ubus_rpc_session argument */
+ if (!strcmp("ubus_rpc_session", (char *)hdr->name) && blob_id(attr) == BLOBMSG_TYPE_STRING)
+ continue;
+
goto inval;
+ }
}
*res = rpc_ucode_blob_array_to_ucv(&script->vm, blob_data(msg), blob_len(msg), true);