From: Evgeny Vereshchagin Date: Thu, 31 Aug 2017 08:38:30 +0000 (+0300) Subject: sd-bus: use -- when passing arguments to ssh (#6706) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=bc8491844602f0d0626af7ff9e0f988a546bf1d7;p=elogind.git 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 ``` --- 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;