two tests fail in a user namespace where DBUS_USER, DBUS_TEST_USER are not mapped
To reproduce
Run the test suite in an environment where dbus thinks it is uid 0, but no other uids are mapped. For example, a Linux user namespace created by bubblewrap has only two uids inside the container: one uid of the user's choice (really the user's own uid), and the overflow uid nobody
, therefore we cannot switch to uid messagebus
.
bwrap \
--dev-bind / / \
--unshare-user \
--uid 0 \
--gid 0 \
meson test -C builddir
Expected result
Tests pass. Some tests cannot be executed like this and are skipped.
Actual result
Tests that involve dropping privileges from uid 0 to messagebus
fail.
test-dbus-daemon
fails in /fd-limit/system
because a dbus-daemon resembling the system bus fails to start:
dbus-daemon[12345]: Failed to start message bus: Failed to drop capabilities: Operation not permitted
test-uid-permissions
also fails:
Bail out! FATAL-ERROR: setresuid(65534, (same), 0): Invalid argument
** (...test-uid-permissions): ERROR **: (timestamp): could not setuid (104): Invalid argument
** (...test-uid-permissions): ERROR **: (timestamp): setresuid(65534, (same), 0): Invalid argument