From bc8491844602f0d0626af7ff9e0f988a546bf1d7 Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Thu, 31 Aug 2017 11:38:30 +0300 Subject: [PATCH] sd-bus: use -- when passing arguments to ssh (#6706) This prevents `systemctl` from runnning /bin/touch when the following command is used: ``` systemctl -H '-oProxyCommand=/bin/touch i-shouldnt-be-here' show-environment ``` --- src/libelogind/sd-bus/sd-bus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libelogind/sd-bus/sd-bus.c b/src/libelogind/sd-bus/sd-bus.c index 3f2d1b0bc..7bc0c056b 100644 --- a/src/libelogind/sd-bus/sd-bus.c +++ b/src/libelogind/sd-bus/sd-bus.c @@ -49,7 +49,6 @@ #include "macro.h" #include "missing.h" #include "parse-util.h" -#include "process-util.h" #include "string-util.h" #include "strv.h" #include "util.h" @@ -1209,7 +1208,7 @@ int bus_set_address_system_remote(sd_bus *b, const char *host) { if (!e) return -ENOMEM; - c = strjoina(",argv4=--machine=", m); + c = strjoina(",argv5=--machine=", m); } } @@ -1219,7 +1218,7 @@ int bus_set_address_system_remote(sd_bus *b, const char *host) { return -ENOMEM; } - b->address = strjoin("unixexec:path=ssh,argv1=-xT,argv2=", e, ",argv3=systemd-stdio-bridge", c); + b->address = strjoin("unixexec:path=ssh,argv1=-xT,argv2=--,argv3=", e, ",argv4=systemd-stdio-bridge", c); if (!b->address) return -ENOMEM; -- 2.30.2