mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-12-27 22:25:19 +07:00
dbus-manager: fix tainted string
The pointer to the end of the string was not advanced after adding the "cgroups-missing" taint. If "local-hwclock" was detected too, it would overwrite the previous string. With 'e' always pointing to the end of the string, removing the last delimiter is easier.
This commit is contained in:
parent
b809bd0940
commit
1ebf0cb73d
@ -310,13 +310,14 @@ static int bus_manager_append_tainted(DBusMessageIter *i, const char *property,
|
||||
free(p);
|
||||
|
||||
if (access("/proc/cgroups", F_OK) < 0)
|
||||
stpcpy(e, "cgroups-missing:");
|
||||
e = stpcpy(e, "cgroups-missing:");
|
||||
|
||||
if (hwclock_is_localtime() > 0)
|
||||
stpcpy(e, "local-hwclock:");
|
||||
e = stpcpy(e, "local-hwclock:");
|
||||
|
||||
if (endswith(buf, ":"))
|
||||
buf[strlen(buf)-1] = 0;
|
||||
/* remove the last ':' */
|
||||
if (e != buf)
|
||||
e[-1] = 0;
|
||||
|
||||
t = buf;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user