]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bus-unit-util: don't validate partition designator client side
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Feb 2021 12:36:43 +0000 (13:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Feb 2021 12:36:43 +0000 (13:36 +0100)
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.

src/shared/bus-unit-util.c

index eaec48fd5e2ace6412af2391a15c97198c1a71fc..ce9ae89fe6658e52f9150389c15788f04f62586d 100644 (file)
@@ -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);