From: Lennart Poettering Date: Thu, 25 Feb 2021 12:36:43 +0000 (+0100) Subject: bus-unit-util: don't validate partition designator client side X-Git-Tag: v248-rc3~110^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a7865cc431f585d09a35daf186eab7c92e596bb;p=thirdparty%2Fsystemd.git bus-unit-util: don't validate partition designator client side When we parse properties set via "systemctl set-property" we should validate to the point where the data we pass over the bus makes rough sense, but we shouldn't needlessly check whether specified enum values are among the known enum values. The server side checks that anyway again, and it's kinda nice if an older systemctl can be used to talk to a newer systemd. --- diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index eaec48fd5e2..ce9ae89fe66 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -1631,10 +1631,6 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con return log_error_errno(r, "Failed to parse argument: %m"); STRV_FOREACH_PAIR(first, second, l) { - /* Format is either 'root:foo' or 'foo' (root is implied) */ - if (!isempty(*second) && partition_designator_from_string(*first) < 0) - return bus_log_create_error(-EINVAL); - r = sd_bus_message_append(m, "(ss)", !isempty(*second) ? *first : "root", !isempty(*second) ? *second : *first); @@ -1734,9 +1730,6 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con break; } - if (partition_designator_from_string(partition) < 0) - return bus_log_create_error(-EINVAL); - r = sd_bus_message_append(m, "(ss)", partition, mount_options); if (r < 0) return bus_log_create_error(r); @@ -1838,9 +1831,6 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con break; } - if (partition_designator_from_string(partition) < 0) - return bus_log_create_error(-EINVAL); - r = sd_bus_message_append(m, "(ss)", partition, mount_options); if (r < 0) return bus_log_create_error(r);