#915625 dbus-run-session does not work under fakeroot

Package:
dbus
Source:
dbus
Description:
simple interprocess messaging system (system message bus)
Submitter:
Andreas Beckmann
Date:
2018-12-05 18:39:02 UTC
Severity:
important
#915625#5
Date:
2018-12-05 12:21:20 UTC
From:
To:
Hi,

dbus-run-session cannot be used under fakeroot:

$ fakeroot dbus-run-session -- dbus-send --session --type=signal / local.AutotestCheck.Hello ; echo $?
org.freedesktop.DBus.Error.AccessDenied: Failed to set fd limit to 65536: Operation not permitted
Cannot setup inotify for '/root/.local/share/dbus-1/services'; error 'Permission denied'
Failed to open connection to "session" message bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
1

$ dbus-run-session -- dbus-send --session --type=signal / local.AutotestCheck.Hello ; echo $?
0


I found this whily trying to analyze why qtbase-opensource-src
FTBFS twice in a row - the build system performs some dbus checks
during make distclean (called from debian/rules clean, which runs
under fakeroot).


Andreas

#915625#14
Date:
2018-12-05 18:35:49 UTC
From:
To:
pretending to be someone else seems a rather precarious situation to be
in, and it isn't entirely surprising if software gets it wrong.

Workaround: set $XDG_DATA_HOME to a path under your control (which is
probably a good idea anyway in situations like this).

This is because dbus-daemon assumes that uid 0 is meant to be able to
increase its resource limits. The warning is harmless (as long as the
dbus-daemon doesn't receive so many connections or fd-passing messages
that its resource limit runs out).

This appears to be because init_system_db() in dbus-userdb.c doesn't
special-case the current uid to use $HOME in preference to the
user's "official" home directory from getpwent() (/etc/passwd), like
_dbus_homedir_from_uid() now does (since 1.11.x). That seems like a bug
in 1.12.x and later versions.

That function is indirectly used when computing the default value of
$XDG_DATA_HOME, and as far as I can see, nowhere else.

1.10.x and older versions of dbus made no attempt to respect $HOME and
would always go directly to getpwent(), which is unhelpful but at least
consistent.
place to be doing things with D-Bus?

If qtbase-opensource-src can safely have "Rules-Requires-Root: no"
then it probably doesn't need to use fakeroot.

Sorry, the Debian 8 (1.8.x) version of dbus is not going to receive
upstream or Debian maintainer attention for anything short of an
emergency. The 1.10.x branch is officially security fixes only (or in
practice security fixes, fixes that could be argued to potentially impact
security, and CI failures that can't be worked around), while 1.8.x and
older have reached end-of-life.

    smcv