chiark / gitweb /
hwclock: add taint flag for non-local hwclock
[elogind.git] / src / core / dbus-manager.c
index e81e6afb046d2fa2eeb76ab2c03878574063404c..6655f2940ca8b82ebae0871a35f9c38256455c04 100644 (file)
         "  <property name=\"UnitPath\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"NotifySocket\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"ControlGroupHierarchy\" type=\"s\" access=\"read\"/>\n" \
-        "  <property name=\"MountAuto\" type=\"b\" access=\"read\"/>\n" \
-        "  <property name=\"SwapAuto\" type=\"b\" access=\"read\"/>\n"  \
         "  <property name=\"DefaultControllers\" type=\"as\" access=\"read\"/>\n" \
         "  <property name=\"DefaultStandardOutput\" type=\"s\" access=\"read\"/>\n" \
         "  <property name=\"DefaultStandardError\" type=\"s\" access=\"read\"/>\n" \
@@ -296,17 +294,23 @@ static int bus_manager_append_tainted(DBusMessageIter *i, const char *property,
         assert(m);
 
         if (m->taint_usr)
-                e = stpcpy(e, "usr-separate-fs ");
+                e = stpcpy(e, "split-usr:");
 
         if (readlink_malloc("/etc/mtab", &p) < 0)
-                e = stpcpy(e, "etc-mtab-not-symlink ");
+                e = stpcpy(e, "mtab-not-symlink:");
         else
                 free(p);
 
         if (access("/proc/cgroups", F_OK) < 0)
-                stpcpy(e, "cgroups-missing ");
+                stpcpy(e, "cgroups-missing:");
 
-        t = strstrip(buf);
+        if (hwclock_is_localtime() > 0)
+                stpcpy(e, "local-hwclock:");
+
+        if (endswith(buf, ":"))
+                buf[strlen(buf)-1] = 0;
+
+        t = buf;
 
         if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
                 return -ENOMEM;
@@ -554,8 +558,6 @@ static const BusProperty bus_manager_properties[] = {
         { "UnitPath",      bus_property_append_strv,              "as", offsetof(Manager, lookup_paths.unit_path),     true },
         { "NotifySocket",  bus_property_append_string,             "s", offsetof(Manager, notify_socket),              true },
         { "ControlGroupHierarchy", bus_property_append_string,     "s", offsetof(Manager, cgroup_hierarchy),           true },
-        { "MountAuto",     bus_property_append_bool,               "b", offsetof(Manager, mount_auto)                  },
-        { "SwapAuto",      bus_property_append_bool,               "b", offsetof(Manager, swap_auto)                   },
         { "DefaultControllers", bus_property_append_strv,         "as", offsetof(Manager, default_controllers),        true },
         { "DefaultStandardOutput", bus_manager_append_exec_output, "s", offsetof(Manager, default_std_output)          },
         { "DefaultStandardError",  bus_manager_append_exec_output, "s", offsetof(Manager, default_std_error)           },
@@ -1470,6 +1472,7 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                 const char *name, *smode, *old_name = NULL;
                 JobMode mode;
                 Job *j;
+                JobBusClient *cl;
                 Unit *u;
                 bool b;
 
@@ -1527,10 +1530,11 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection,
                 if ((r = manager_add_job(m, job_type, u, mode, true, &error, &j)) < 0)
                         return bus_send_error_reply(connection, message, &error, r);
 
-                if (!(j->bus_client = strdup(message_get_sender_with_fallback(message))))
+                cl = job_bus_client_new(connection, message_get_sender_with_fallback(message));
+                if (!cl)
                         goto oom;
 
-                j->bus = connection;
+                LIST_PREPEND(JobBusClient, client, j->bus_client_list, cl);
 
                 if (!(reply = dbus_message_new_method_return(message)))
                         goto oom;