chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow for the use of @ in remote host calls
[elogind.git]
/
src
/
systemctl
/
systemctl.c
diff --git
a/src/systemctl/systemctl.c
b/src/systemctl/systemctl.c
index 0ba3568a1e9309a6a5615116173898522158bede..3e4cefec7689d5784ec54b91906a640aff0253e3 100644
(file)
--- 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;
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;
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;
case 'H':
arg_transport = TRANSPORT_SSH;
-
arg_host = optarg
;
+
parse_user_at_host(optarg, &arg_user, &arg_host)
;
break;
case ARG_RUNTIME:
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_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...");
private_bus = false;
} else
assert_not_reached("Uh, invalid transport...");