From 1a4634b6f4560b4eb309936f4dcad0580ffaaf0e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 23 Feb 2023 18:03:50 +0900 Subject: [PATCH] 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 4de2b47bdec8bbb7df78678a152f18281b20e7b5) (cherry picked from commit e093acd062f36de4471948c6d932b931333af4da) (cherry picked from commit 22d1f01b052e5f938201340a0279f2013bcf8986) --- src/core/dbus-socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c index 43edbb60e4..6173d3ff7e 100644 --- a/src/core/dbus-socket.c +++ b/src/core/dbus-socket.c @@ -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);