9 #include <sys/capability.h>
15 namespace swissknife {
18 cap_value_t cap = CAP_DAC_READ_SEARCH;
19 #ifdef CAP_IS_SUPPORTED
20 assert(CAP_IS_SUPPORTED(cap));
23 cap_t caps_proc = cap_get_proc();
26 cap_flag_value_t cap_state;
27 int retval = cap_get_flag(caps_proc, cap, CAP_EFFECTIVE, &cap_state);
30 if (cap_state == CAP_SET) {
35 retval = cap_get_flag(caps_proc, cap, CAP_PERMITTED, &cap_state);
37 if (cap_state != CAP_SET) {
39 "Warning: CAP_DAC_READ_SEARCH cannot be obtained. "
40 "It's not in the process's permitted set.");
45 retval = cap_set_flag(caps_proc, CAP_EFFECTIVE, 1, &cap, CAP_SET);
48 retval = cap_set_proc(caps_proc);
53 "Cannot reset capabilities for current process "
assert((mem||(size==0))&&"Out Of Memory")
bool ObtainDacReadSearchCapability()
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)