chiark / gitweb /
bus: drop creds->capability_size
authorDavid Herrmann <dh.herrmann@gmail.com>
Tue, 30 Dec 2014 07:42:53 +0000 (08:42 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Tue, 30 Dec 2014 07:42:53 +0000 (08:42 +0100)
commit34a5d5e52661212c7a145cbab45e70a6df7ba284
tree5488f02fc0ebd7fc76670a01d3e390494c06c7a9
parent180a60bc879ab0554297bc08a7a0b9274b119b55
bus: drop creds->capability_size

The number of available caps can be read from
/proc/sys/kernel/cap_last_cap during runtime. Our helper cap_last_cap()
does that, so there's no reason to remember the size of any capability
cache. We can just pre-allocate arrays with a suitable size for all
available caps and reject any higher caps.

The kernel capability API uses u32 as base so make sure we do the same.
Note that this is specified by POSIX, so it's unlikely to change.
src/libsystemd/sd-bus/bus-control.c
src/libsystemd/sd-bus/bus-creds.c
src/libsystemd/sd-bus/bus-creds.h
src/libsystemd/sd-bus/bus-kernel.c