1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-26 08:55:18 +03:00

core/dbus-socket: check the socket path is absolute

In config_parse_socket_listen(), we have checked the path is absolute,
however we have not in the dbus method.

(cherry picked from commit 4de2b47bde)
(cherry picked from commit e093acd062)
This commit is contained in:
Yu Watanabe 2023-02-23 18:03:50 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent dd6561ff3e
commit 22d1f01b05

View File

@ -380,7 +380,7 @@ static int bus_socket_set_transient_property(
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Unknown Socket type: %s", t);
if (p->type != SOCKET_SOCKET) {
if (!path_is_valid(a))
if (!path_is_absolute(a) || !path_is_valid(a))
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid socket path: %s", a);
p->path = strdup(a);