summaryrefslogtreecommitdiff
path: root/source3/wscript
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2010-03-22 08:48:09 +0100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:03 +1000
commit3bc6cf80972780e492f6f212a9591ba12b5f6f43 (patch)
tree5860f1916f1346b824171798c7dfe6f7892bd54a /source3/wscript
parent22d9f3d7c5c01c2d8450352f622e7a498aa2bc46 (diff)
downloadsamba-3bc6cf80972780e492f6f212a9591ba12b5f6f43.tar.gz
samba-3bc6cf80972780e492f6f212a9591ba12b5f6f43.tar.bz2
samba-3bc6cf80972780e492f6f212a9591ba12b5f6f43.zip
build: Check for POSIX capabilities
Diffstat (limited to 'source3/wscript')
-rw-r--r--source3/wscript19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/wscript b/source3/wscript
index 17b1f857d7..664ec7417a 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -117,6 +117,25 @@ main() {
conf.CHECK_STRUCTURE_MEMBER('struct stat', 'st_blksize', define='HAVE_STAT_ST_BLKSIZE',
headers='sys/types.h sys/stat.h unistd.h')
+ # Check for POSIX capability support
+ if "HAVE_SYS_CAPABILITY_H" in conf.env:
+ conf.CHECK_FUNCS_IN('cap_get_proc', 'cap')
+ conf.CHECK_CODE('''
+#include <sys/types.h>
+#include <sys/capability.h>
+main() {
+ cap_t cap;
+ cap_value_t vals[1];
+ if (!(cap = cap_get_proc()))
+ exit(1);
+ vals[0] = CAP_CHOWN;
+ cap_set_flag(cap, CAP_INHERITABLE, 1, vals, CAP_CLEAR);
+ cap_set_proc(cap);
+ exit(0);
+ }''', 'HAVE_POSIX_CAPABILITIES', addmain=False, execute=True, cflags="-lcap",
+ msg="Checking whether POSIX capabilities are available")
+
+
# Look for CUPS
conf.find_program('cups-config', var='CUPS_CONFIG')
if conf.env.CUPS_CONFIG: