From: Zbigniew Jędrzejewski-Szmek Date: Wed, 23 Jun 2021 16:10:57 +0000 (+0200) Subject: dbus-socket: fix check of Listen* arguments X-Git-Tag: v249-rc2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aeecab3804aae973577f36880af4b7799e4eb7d5;p=thirdparty%2Fsystemd.git dbus-socket: fix check of Listen* arguments We checked the wrong field, which was always NULL here, so we would always reject the assignment. We would also print the wrong string in the error message: $ sudo systemd-run --socket-property ListenFIFO=/tmp/fifo3 cat Failed to start transient socket unit: Invalid socket path: FIFO --- diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c index 61c2f1a1993..f45a5c16eb4 100644 --- a/src/core/dbus-socket.c +++ b/src/core/dbus-socket.c @@ -383,8 +383,8 @@ 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(p->path)) - return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid socket path: %s", t); + if (!path_is_valid(a)) + return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid socket path: %s", a); p->path = strdup(a); if (!p->path)