summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorDaniel Wallace <danielwallace@gtmanfred.com>2013-06-09 15:54:39 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-06-09 18:26:41 -0400
commit7085053a437456ab87d726f3697002dd811fdf7a (patch)
treeca12f96e9cb69ee08fa3a5558c42650692dcfb28 /src/systemctl
parent856323c9cb0ef368367126588d0b43b4846ab0d7 (diff)
Allow for the use of @ in remote host calls
Without this you have to use %40 with the -H flag because dbus doesn't like the @ sign being unescaped.
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 0ba3568a1e..3e4cefec76 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -129,7 +129,8 @@ static enum transport {
TRANSPORT_SSH,
TRANSPORT_POLKIT
} arg_transport = TRANSPORT_NORMAL;
-static const char *arg_host = NULL;
+static char *arg_host = NULL;
+static char *arg_user = NULL;
static unsigned arg_lines = 10;
static OutputMode arg_output = OUTPUT_SHORT;
static bool arg_plain = false;
@@ -5065,7 +5066,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
case 'H':
arg_transport = TRANSPORT_SSH;
- arg_host = optarg;
+ parse_user_at_host(optarg, &arg_user, &arg_host);
break;
case ARG_RUNTIME:
@@ -6086,7 +6087,7 @@ int main(int argc, char*argv[]) {
bus_connect_system_polkit(&bus, &error);
private_bus = false;
} else if (arg_transport == TRANSPORT_SSH) {
- bus_connect_system_ssh(NULL, arg_host, &bus, &error);
+ bus_connect_system_ssh(arg_user, arg_host, &bus, &error);
private_bus = false;
} else
assert_not_reached("Uh, invalid transport...");