selftests/bpf: fix broken build
Recent merge of 'linux-kselftest-4.11-rc1' tree broke bpf test build. None of the tests were building and test_verifier.c had tons of compiler errors. Fix it and add #ifdef CAP_IS_SUPPORTED to support old versions of libcap. Tested on centos 6.8 and 7 Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
此提交包含在:
@@ -8,6 +8,8 @@
|
||||
* License as published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <linux/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -4583,10 +4585,12 @@ static bool is_admin(void)
|
||||
cap_flag_value_t sysadmin = CAP_CLEAR;
|
||||
const cap_value_t cap_val = CAP_SYS_ADMIN;
|
||||
|
||||
#ifdef CAP_IS_SUPPORTED
|
||||
if (!CAP_IS_SUPPORTED(CAP_SETFCAP)) {
|
||||
perror("cap_get_flag");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
caps = cap_get_proc();
|
||||
if (!caps) {
|
||||
perror("cap_get_proc");
|
||||
|
新增問題並參考
封鎖使用者