Add support for FreeBSD

System Internals / PulseAudio - Ryan Lortie [desrt.ca] - 20 December 2013 13:48 UTC

cap_init() and friends are Linux-specific, so only use them if we're on Linux.

Add support for FreeBSD capabilities if we find to be available there.

Add an #else (not Linux or FreeBSD) case with an #error requesting contributions for other platforms.

This patch keeps the cap_init check in configure.ac but removes the error if it fails. This will ensure we link to -lcap if needed, but won't fail for the case that capabilities are part of the core system (as on FreeBSD).

We do however, modify the header check to ensure we fail if there is no at all and we are on a system where it could be installed. The logic here is that it is better to give the user the chance to install it than it is to proceed silently with a disabled security feature on a system where it could easily be supported.
--without-caps remains an option if the user wants to force it.

https://bugs.freedesktop.org/show_bug.cgi?id=72580

1da34e9 Add support for FreeBSD
configure.ac | 24 ++++++++++++++++--------
src/daemon/caps.c | 6 ++++++
2 files changed, 22 insertions(+), 8 deletions(-)

Upstream: cgit.freedesktop.org


  • Share