Skip to content

test: Skip tests that involve switching uid if unable to do so

Simon McVittie requested to merge smcv/dbus:uid-0-in-userns into master

In a Linux user namespace, it is possible that we are uid 0 but are unable to switch to some other uid like DBUS_USER or DBUS_TEST_USER, because the other uid is not "mapped" in the user namespace, resulting in setuid() or setresuid() failing with EINVAL "Invalid argument". For example, it's easy for this to happen when running under the bubblewrap tool.

Try to drop privileges in a child process, and skip the test if we are unable to do so.

Resolves: #407 (closed)

Merge request reports