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
```
This commit is contained in:
Evgeny Vereshchagin 2017-08-31 11:38:30 +03:00 committed by Lennart Poettering
parent ea89a119cd
commit 58c6e4a2c0

View 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;