chiark / gitweb /
sd-bus: use -- when passing arguments to ssh (#6706)
authorEvgeny Vereshchagin <evvers@ya.ru>
Thu, 31 Aug 2017 08:38:30 +0000 (11:38 +0300)
committerSven Eden <yamakuzure@gmx.net>
Mon, 25 Sep 2017 12:36:18 +0000 (14:36 +0200)
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

index 3f2d1b0bc8ae87cab71b63a13c5e4b668c827a78..7bc0c056b8c55dc5f3e3ddd360d3ba056a80076e 100644 (file)
@@ -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;