From 7f0d207d2c816e0a8cb2742b0a789911f7c99356 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 3 Jul 2014 01:17:26 +0200 Subject: sd-bus: support connecting to remote hosts, directly into containers systemctl -H root@foobar:waldi will now show a list of services running on container "waldi" on host "foobar", using "root" for authenticating at "foobar". Since entereing a container requires priviliges, this will only work correctly for root logins. --- src/machine/machined-dbus.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/machine/machined-dbus.c') diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index 0078a277d9..6f8ba474fa 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -41,23 +41,6 @@ #include "cgroup-util.h" #include "machined.h" -static bool valid_machine_name(const char *p) { - size_t l; - - if (!filename_is_safe(p)) - return false; - - if (!ascii_is_valid(p)) - return false; - - l = strlen(p); - - if (l < 1 || l> 64) - return false; - - return true; -} - static int method_get_machine(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) { _cleanup_free_ char *p = NULL; Manager *m = userdata; @@ -185,7 +168,7 @@ static int method_create_or_register_machine(Manager *manager, sd_bus_message *m r = sd_bus_message_read(message, "s", &name); if (r < 0) return r; - if (!valid_machine_name(name)) + if (!machine_name_is_valid(name)) return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid machine name"); r = sd_bus_message_read_array(message, 'y', &v, &n); -- cgit v1.2.3-54-g00ecf