summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-06-23 18:10:57 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-07-20 17:59:39 +0200
commit7bdc7ff0bb2d1dde1a81b2cbc76e424d1c50b7aa (patch)
treedd20940fc112e9544a65ed9c9e5233a001da9844
parent0d18f706a3816464053003b706bb6b2c27de12d1 (diff)
downloadsystemd-7bdc7ff0bb2d1dde1a81b2cbc76e424d1c50b7aa.tar.gz
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 (cherry picked from commit aeecab3804aae973577f36880af4b7799e4eb7d5) (cherry picked from commit 78fb13b38572f6649f1e9822ef6acb8ca4952c12)
-rw-r--r--src/core/dbus-socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c
index 2c9da7412a..2953d38114 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)