From 7085053a437456ab87d726f3697002dd811fdf7a Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Sun, 9 Jun 2013 15:54:39 -0500 Subject: 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. --- src/systemctl/systemctl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/systemctl') 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..."); -- cgit v1.2.3-54-g00ecf