chiark / gitweb /
Allow for the use of @ in remote host calls
[elogind.git] / src / login / loginctl.c
index caaea8dfaa5af7f070e4a82ea40732227612964d..b09aa37ff888784b2551db4016c6393d9ae1ca57 100644 (file)
@@ -50,7 +50,8 @@ static enum transport {
         TRANSPORT_POLKIT
 } arg_transport = TRANSPORT_NORMAL;
 static bool arg_ask_password = true;
-static const char *arg_host = NULL;
+static char *arg_host = NULL;
+static char *arg_user = NULL;
 
 static void pager_open_if_enabled(void) {
 
@@ -1421,7 +1422,7 @@ static int 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_FULL: