]> code.delx.au - pulseaudio/commit
Add support for FreeBSD <sys/capability.h>
authorRyan Lortie <desrt@desrt.ca>
Tue, 10 Dec 2013 21:47:53 +0000 (16:47 -0500)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 20 Dec 2013 19:48:50 +0000 (21:48 +0200)
commit1da34e99b203de14a45c94ec768faf04d41eca5b
tree8768e936f1d51ede3664a578a767b95bd723c7f5
parent5d2d9e57006c6509ef6d173b89502685ff429449
Add support for FreeBSD <sys/capability.h>

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

Add support for FreeBSD capabilities if we find <sys/capability.h> 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
<sys/capability.h> 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
configure.ac
src/daemon/caps.c