summaryrefslogtreecommitdiff
path: root/src/shared/util.c
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/shared/util.c
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/shared/util.c')
-rw-r--r--src/shared/util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 2edf9cd875..d0bbf78bf3 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -5847,3 +5847,17 @@ bool id128_is_valid(const char *s) {
return true;
}
+
+void parse_user_at_host(char *arg, char **user, char **host) {
+ assert(arg);
+ assert(user);
+ assert(host);
+
+ *host = strchr(arg, '@');
+ if (*host == NULL)
+ *host = arg;
+ else {
+ *host[0]++ = '\0';
+ *user = arg;
+ }
+}