dbus-daemon test: Don't test fd limits if in an unprivileged container
authorSimon McVittie <smcv@collabora.com>
Tue, 4 Dec 2018 12:09:26 +0000 (12:09 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 15 May 2020 10:23:15 +0000 (11:23 +0100)
commit041d579139be1f2645281e93dbc7ccd8ba7cda61
tree2c59f88e283897fc89620c0642e81cfacc68be66
parent55b3f71376d9a3cb01cdf5caa381b030f7bb0fa4
dbus-daemon test: Don't test fd limits if in an unprivileged container

In an unprivileged container, uid 0 doesn't have CAP_SYS_RESOURCE, so
we can't expect the dbus-daemon to be able to escalate its fd limit.

This can be reproduced using bubblewrap:

    sudo bwrap \
        --cap-drop CAP_SYS_RESOURCE \
        --ro-bind / / \
        --dev /dev \
    env \
        DBUS_TEST_DAEMON=.../bus/dbus-daemon \
        DBUS_TEST_DATA=.../test/data \
    .../test/test-dbus-daemon \
        -p /fd-limit \
        --verbose

Bug-Debian: https://bugs.debian.org/908092
test/dbus-daemon.c