diff options
author | Kai Blin <kai@samba.org> | 2010-03-22 08:48:09 +0100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-06 20:27:03 +1000 |
commit | 3bc6cf80972780e492f6f212a9591ba12b5f6f43 (patch) | |
tree | 5860f1916f1346b824171798c7dfe6f7892bd54a /source3/wscript | |
parent | 22d9f3d7c5c01c2d8450352f622e7a498aa2bc46 (diff) | |
download | samba-3bc6cf80972780e492f6f212a9591ba12b5f6f43.tar.gz samba-3bc6cf80972780e492f6f212a9591ba12b5f6f43.tar.bz2 samba-3bc6cf80972780e492f6f212a9591ba12b5f6f43.zip |
build: Check for POSIX capabilities
Diffstat (limited to 'source3/wscript')
-rw-r--r-- | source3/wscript | 19 |
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: |