From e37fae1ea0c491e7c5ac1d364a80e2f846fbc312 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 24 Oct 2017 12:26:36 +0200 Subject: [PATCH] core: include a bad /var/run symlink in the "tainted" string --- src/core/dbus-manager.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c index f87b52a..c9da053 100644 --- a/src/core/dbus-manager.c +++ b/src/core/dbus-manager.c @@ -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; -- 2.7.4