chiark / gitweb /
build-sys: add a makefile target to run all tests through valgrind
[elogind.git] / src / login / logind-user-dbus.c
index 8cc1dd49fde26500ad877a6a82ed13cdeb696137..fa2ecba53cc25ac5150c4603485981bf9ea164a7 100644 (file)
         "  <property name=\"Timestamp\" type=\"t\" access=\"read\"/>\n" \
         "  <property name=\"TimestampMonotonic\" type=\"t\" access=\"read\"/>\n" \
         "  <property name=\"RuntimePath\" type=\"s\" access=\"read\"/>\n" \
-        "  <property name=\"DefaultControlGroup\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"Service\" type=\"s\" access=\"read\"/>\n"   \
+        "  <property name=\"Slice\" type=\"s\" access=\"read\"/>\n"     \
         "  <property name=\"Display\" type=\"(so)\" access=\"read\"/>\n" \
         "  <property name=\"State\" type=\"s\" access=\"read\"/>\n"     \
         "  <property name=\"Sessions\" type=\"a(so)\" access=\"read\"/>\n" \
         "  <property name=\"IdleHint\" type=\"b\" access=\"read\"/>\n"  \
         "  <property name=\"IdleSinceHint\" type=\"t\" access=\"read\"/>\n" \
         "  <property name=\"IdleSinceHintMonotonic\" type=\"t\" access=\"read\"/>\n" \
-        " </interface>\n"                                               \
+        " </interface>\n"
 
 #define INTROSPECTION                                                   \
         DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE                       \
@@ -65,7 +65,7 @@ static int bus_user_append_display(DBusMessageIter *i, const char *property, voi
         DBusMessageIter sub;
         User *u = data;
         const char *id, *path;
-        char _cleanup_free_ *p = NULL;
+        _cleanup_free_ char *p = NULL;
 
         assert(i);
         assert(property);
@@ -185,24 +185,6 @@ static int bus_user_append_idle_hint_since(DBusMessageIter *i, const char *prope
         return 0;
 }
 
-static int bus_user_append_default_cgroup(DBusMessageIter *i, const char *property, void *data) {
-        User *u = data;
-        char _cleanup_free_ *t = NULL;
-        int r;
-        bool success;
-
-        assert(i);
-        assert(property);
-        assert(u);
-
-        r = cg_join_spec(SYSTEMD_CGROUP_CONTROLLER, u->cgroup_path, &t);
-        if (r < 0)
-                return r;
-
-        success = dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t);
-        return success ? 0 : -ENOMEM;
-}
-
 static int get_user_for_path(Manager *m, const char *path, User **_u) {
         User *u;
         unsigned long lu;
@@ -212,10 +194,10 @@ static int get_user_for_path(Manager *m, const char *path, User **_u) {
         assert(path);
         assert(_u);
 
-        if (!startswith(path, "/org/freedesktop/login1/user/"))
+        if (!startswith(path, "/org/freedesktop/login1/user/_"))
                 return -EINVAL;
 
-        r = safe_atolu(path + 29, &lu);
+        r = safe_atolu(path + 30, &lu);
         if (r < 0)
                 return r;
 
@@ -234,8 +216,8 @@ static const BusProperty bus_login_user_properties[] = {
         { "Timestamp",              bus_property_append_usec,        "t", offsetof(User, timestamp.realtime)  },
         { "TimestampMonotonic",     bus_property_append_usec,        "t", offsetof(User, timestamp.monotonic) },
         { "RuntimePath",            bus_property_append_string,      "s", offsetof(User, runtime_path),       true },
-        { "DefaultControlGroup",    bus_user_append_default_cgroup,  "s", 0 },
         { "Service",                bus_property_append_string,      "s", offsetof(User, service),            true },
+        { "Slice",                  bus_property_append_string,      "s", offsetof(User, slice),              true },
         { "Display",                bus_user_append_display,      "(so)", 0 },
         { "State",                  bus_user_append_state,           "s", 0 },
         { "Sessions",               bus_user_append_sessions,    "a(so)", 0 },
@@ -348,7 +330,7 @@ char *user_bus_path(User *u) {
 
         assert(u);
 
-        if (asprintf(&s, "/org/freedesktop/login1/user/%llu", (unsigned long long) u->uid) < 0)
+        if (asprintf(&s, "/org/freedesktop/login1/user/_%llu", (unsigned long long) u->uid) < 0)
                 return NULL;
 
         return s;