From: Yu Watanabe Date: Sun, 6 Apr 2025 02:08:10 +0000 (+0900) Subject: bus-unit-util: refuse setting CGroup v1 properties through DBus X-Git-Tag: v258-rc1~812^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5da476ac7728b91ad3a49c1b126b3559b4fbeed8;p=thirdparty%2Fsystemd.git bus-unit-util: refuse setting CGroup v1 properties through DBus --- diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 1e04a051a6d..c0572aff150 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -126,8 +126,6 @@ DEFINE_BUS_APPEND_PARSE_PTR("i", int32_t, int, ioprio_parse_priority); DEFINE_BUS_APPEND_PARSE_PTR("i", int32_t, int, parse_nice); DEFINE_BUS_APPEND_PARSE_PTR("i", int32_t, int, safe_atoi); DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, nsec_t, parse_nsec); -DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, cg_blkio_weight_parse); -DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, cg_cpu_shares_parse); DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, cg_weight_parse); DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, cg_cpu_weight_parse); DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, unsigned long, mount_propagation_flag_from_string); @@ -572,7 +570,6 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons "MemoryAccounting", "MemoryZSwapWriteback", "IOAccounting", - "BlockIOAccounting", "TasksAccounting", "IPAccounting", "CoredumpReceive")) @@ -586,10 +583,6 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons "StartupIOWeight")) return bus_append_cg_weight_parse(m, field, eq); - if (STR_IN_SET(field, "CPUShares", - "StartupCPUShares")) - return bus_append_cg_cpu_shares_parse(m, field, eq); - if (STR_IN_SET(field, "AllowedCPUs", "StartupAllowedCPUs", "AllowedMemoryNodes", @@ -609,10 +602,6 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons return bus_append_byte_array(m, field, array, allocated); } - if (STR_IN_SET(field, "BlockIOWeight", - "StartupBlockIOWeight")) - return bus_append_cg_blkio_weight_parse(m, field, eq); - if (streq(field, "DisableControllers")) return bus_append_strv(m, "DisableControllers", eq, /* separator= */ NULL, EXTRACT_UNQUOTE); @@ -636,7 +625,6 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons "MemoryMax", "MemorySwapMax", "MemoryZSwapMax", - "MemoryLimit", "TasksMax")) { if (streq(eq, "infinity")) { @@ -735,9 +723,7 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons return 1; } - if (cgroup_io_limit_type_from_string(field) >= 0 || - STR_IN_SET(field, "BlockIOReadBandwidth", - "BlockIOWriteBandwidth")) { + if (cgroup_io_limit_type_from_string(field) >= 0) { if (isempty(eq)) r = sd_bus_message_append(m, "(sv)", field, "a(st)", 0); @@ -771,8 +757,7 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons return 1; } - if (STR_IN_SET(field, "IODeviceWeight", - "BlockIODeviceWeight")) { + if (streq(field, "IODeviceWeight")) { if (isempty(eq)) r = sd_bus_message_append(m, "(sv)", field, "a(st)", 0); else {