]> git.ipfire.org Git - thirdparty/systemd.git/commit
test: use cap_last_cap() for max supported cap number, not capability_list_length()
authorDan Streetman <ddstreet@canonical.com>
Wed, 25 Nov 2020 20:22:24 +0000 (15:22 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Dec 2020 17:08:31 +0000 (18:08 +0100)
commitb5d7ba5fd4b61ba4919887cdf4a97c660bd9367b
treebac46f5d74406a316081fb6d68f734a18f150c05
parent89fae89234b78669856f2f815f3fe7c88adec652
test: use cap_last_cap() for max supported cap number, not capability_list_length()

This test assumes capability_list_length() is an invalid cap number,
but that isn't true if the running kernel supports more caps than we were
compiled with, which results in the test failing.

Instead use cap_last_cap() + 1.

If cap_last_cap() is 63, there are no more 'invalid' cap numbers to test with,
so the invalid cap number test part is skipped.

(cherry picked from commit ebc815cd1c647faa934a446ceea91ff4bc9dffa4)
src/basic/cap-list.c
src/test/test-cap-list.c