core: include a bad /var/run symlink in the "tainted" string
authorLennart Poettering <lennart@poettering.net>
Tue, 24 Oct 2017 10:26:36 +0000 (12:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 10 Nov 2017 18:00:06 +0000 (19:00 +0100)
src/core/dbus-manager.c

index f87b52a..c9da053 100644 (file)
@@ -139,8 +139,10 @@ static int property_get_tainted(
                 void *userdata,
                 sd_bus_error *error) {
 
-        char buf[sizeof("split-usr:cgroups-missing:local-hwclock:")] = "", *e = buf;
+        char buf[sizeof("split-usr:cgroups-missing:local-hwclock:var-run-bad:")] = "", *e = buf;
+        _cleanup_free_ char *destination = NULL;
         Manager *m = userdata;
+        int r;
 
         assert(bus);
         assert(reply);
@@ -155,6 +157,10 @@ static int property_get_tainted(
         if (clock_is_localtime(NULL) > 0)
                 e = stpcpy(e, "local-hwclock:");
 
+        r = readlink_malloc("/var/run", &destination);
+        if (r < 0 || !PATH_IN_SET(destination, "../run", "/run"))
+                e = stpcpy(e, "var-run-bad:");
+
         /* remove the last ':' */
         if (e != buf)
                 e[-1] = 0;