]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
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)
committerLennart Poettering <lennart@poettering.net>
Thu, 31 Aug 2017 08:38:30 +0000 (10:38 +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/libsystemd/sd-bus/sd-bus.c

index 261152b9bf9bc766bc6edacb764fbb3a6c91b8aa..aea050e2b95a75a01820a4c0e5d6bce32b695e6e 100644 (file)
@@ -1186,7 +1186,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);
                 }
         }
 
@@ -1196,7 +1196,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;