The logic that sets the dbus-daemon-launcher-helper setuid does not
handle the case where the group named the same as the dbus_user does not
exist.
This makes the assumption that the primary group of the dbus_user
has the same name as the dbus_user.
This may not be the case.
To remedy these issues, obtain the group id for dbus_user instead of
attempting to retrieve the group id by name.
To avoid a failure when the user does not exist, handle the KeyError
exception from the pwd.getpwnam function by printing a warning and
skipping the logic to set the binary setuid.
Perform an additional check to ensure that the dbus_user's primary group
has only a single member.
Fail similarly if it has more than one member.
Resolves: #492
Signed-off-by: Simon McVittie <smcv@collabora.com>
Use install_emptydir() in Meson versions that support it, or a script
with similar invocation in versions that do not. This will make it
straightforward to migrate to install_emptydir() when we drop support
for Meson versions older than 0.60.0.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Replacing the prefix with a path relative to ${pcfiledir} can be harmful
if the number of path components between the prefix and the ${libdir}
is not what we expect, in particular on Debian-derived systems where the
${libdir} is normally lib/x86_64-linux-gnu or similar.
Signed-off-by: Simon McVittie <smcv@collabora.com>