From 44e3c4c8bc031706a236acf9a8d6e5e7c5e2fd0a Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Sat, 13 Sep 2025 01:28:24 +0100 Subject: [PATCH] machine: validate root directory over varlink Use strict validation to reject invalid directories as the D-Bus API already does Follow-up for 5b44c81ff868a4d1b78a74e4770f7a8b2f1d0f91 --- src/machine/machine-varlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine/machine-varlink.c b/src/machine/machine-varlink.c index b2b2f1f2db..5a2f67129e 100644 --- a/src/machine/machine-varlink.c +++ b/src/machine/machine-varlink.c @@ -137,7 +137,7 @@ int vl_method_register(sd_varlink *link, sd_json_variant *parameters, sd_varlink { "leaderProcessId", SD_JSON_VARIANT_OBJECT, machine_pidref, offsetof(Machine, leader), SD_JSON_STRICT }, { "supervisor", _SD_JSON_VARIANT_TYPE_INVALID, machine_pidref, offsetof(Machine, supervisor), SD_JSON_STRICT }, { "supervisorProcessId", SD_JSON_VARIANT_OBJECT, machine_pidref, offsetof(Machine, supervisor), SD_JSON_STRICT }, - { "rootDirectory", SD_JSON_VARIANT_STRING, json_dispatch_path, offsetof(Machine, root_directory), 0 }, + { "rootDirectory", SD_JSON_VARIANT_STRING, json_dispatch_path, offsetof(Machine, root_directory), SD_JSON_STRICT }, { "ifIndices", SD_JSON_VARIANT_ARRAY, machine_ifindices, 0, 0 }, { "vSockCid", _SD_JSON_VARIANT_TYPE_INVALID, machine_cid, offsetof(Machine, vsock_cid), 0 }, { "sshAddress", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(Machine, ssh_address), SD_JSON_STRICT },