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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user