]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/dbus-socket: check the socket path is absolute
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Feb 2023 09:03:50 +0000 (18:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Feb 2023 12:34:16 +0000 (21:34 +0900)
In config_parse_socket_listen(), we have checked the path is absolute,
however we have not in the dbus method.

src/core/dbus-socket.c

index d0d92507d6ab47baee6c5395e7b652f3e4c61783..48e6419130f836a0fdb87e95c40e9c5d5e573b91 100644 (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);