X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fdbus-manager.c;h=2f755bcc64dff28889710d26376af37c79a4f499;hb=ef3102bf436a88fe565de1be655cdb8ca853c495;hp=2edbc37b5e2bfedb8ce8b8b3a49ce6a971893a06;hpb=05feefe0fb049bb0f7c59584058ee0350462920c;p=elogind.git diff --git a/src/dbus-manager.c b/src/dbus-manager.c index 2edbc37b5..2f755bcc6 100644 --- a/src/dbus-manager.c +++ b/src/dbus-manager.c @@ -20,6 +20,7 @@ ***/ #include +#include #include "dbus.h" #include "log.h" @@ -223,17 +224,18 @@ static int bus_manager_append_tainted(Manager *m, DBusMessageIter *i, const char assert(i); assert(property); - if (path_is_mount_point("/usr") > 0 || dir_is_empty("/usr") > 0) - e = stpcpy(e, "usr-separate-fs"); + if (m->taint_usr) + e = stpcpy(e, "usr-separate-fs "); - if (readlink_malloc("/etc/mtab", &p) < 0) { - if (e != buf) - e = stpcpy(e, " "); - e = stpcpy(e, "etc-mtab-not-symlink"); - } else + if (readlink_malloc("/etc/mtab", &p) < 0) + e = stpcpy(e, "etc-mtab-not-symlink "); + else free(p); - t = buf; + if (access("/proc/cgroups", F_OK) < 0) + e = stpcpy(e, "cgroups-missing "); + + t = strstrip(buf); if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t)) return -ENOMEM; @@ -1018,8 +1020,10 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, if (!e) goto oom; - if (!(reply = dbus_message_new_method_return(message))) + if (!(reply = dbus_message_new_method_return(message))) { + strv_free(e); goto oom; + } strv_free(m->environment); m->environment = e; @@ -1106,8 +1110,6 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, goto oom; } - free(path); - if (reply) { if (!dbus_connection_send(connection, reply, NULL)) goto oom; @@ -1115,6 +1117,8 @@ static DBusHandlerResult bus_manager_message_handler(DBusConnection *connection, dbus_message_unref(reply); } + free(path); + return DBUS_HANDLER_RESULT_HANDLED; oom: