From: Thomas Deutschmann Date: Tue, 11 Oct 2016 14:16:23 +0000 (+0200) Subject: common.c: Use _LINUX_CAPABILITY_VERSION_3 in cap_header X-Git-Tag: collectd-5.6.2~17 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5e4f2ae61dc39938c4df857854724ba1d36f3232;p=collectd.git common.c: Use _LINUX_CAPABILITY_VERSION_3 in cap_header While check_capability() function already requires _LINUX_CAPABILITY_VERSION_3 via "#ifdef" since commit 448627953c we still set the cap_header's version to deprecated _LINUX_CAPABILITY_VERSION. This results in a warning like > capability: warning: `collectd' uses 32-bit capabilities (legacy support in use) from the kernel when a plugin (like iptables) calls our check_capability() function. With this commit we will set cap_header to kernel's current capability version (_LINUX_CAPABILITY_VERSION_3), which is default since kernel 2.6.26. Signed-off-by: Florian Forster --- diff --git a/src/daemon/common.c b/src/daemon/common.c index e4894493..477d7599 100644 --- a/src/daemon/common.c +++ b/src/daemon/common.c @@ -1698,7 +1698,7 @@ int check_capability (int capability) /* {{{ */ } cap_header->pid = getpid(); - cap_header->version = _LINUX_CAPABILITY_VERSION; + cap_header->version = _LINUX_CAPABILITY_VERSION_3; if (capget(cap_header, cap_data) < 0) { ERROR("check_capability: capget failed");