]> git.ipfire.org Git - thirdparty/systemd.git/commit
capability: fix loops for cap_last_cap()
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Jun 2019 12:44:47 +0000 (14:44 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Jun 2019 12:55:24 +0000 (14:55 +0200)
commit4a33a02e994c8002a7eac75c02494becb1a4d4f8
tree7aa8fe81ee013026b79c5c7a76cb1f42b4368c55
parent9af2820694e1b2d409ed35cf0bca00acab0bdec5
capability: fix loops for cap_last_cap()

cap_last_cap() returns the last valid cap (instead of the number of
valid caps). to iterate through all known caps we hence need to use a <=
check, and not a < check like for all other cases. We got this right
usually, but in three cases we did not.
src/basic/cap-list.c
src/basic/capability-util.c