From e063ba3535c35a6fb5f66c00d733b9bd7dffa8ff Mon Sep 17 00:00:00 2001 From: luhuaxin Date: Sun, 13 Mar 2022 12:03:34 +0800 Subject: [PATCH] fix cap_struct to adapter libcap 2.61 Signed-off-by: luhuaxin --- lib/cap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cap.c b/lib/cap.c index f7a91fe..c21d025 100644 --- a/lib/cap.c +++ b/lib/cap.c @@ -28,15 +28,17 @@ #endif #define NUMBER_OF_CAP_SETS 3 /* effective, inheritable, permitted */ -#define __CAP_BLKS (_LINUX_CAPABILITY_U32S) +#define __CAP_BLKS (_LINUX_CAPABILITY_U32S_3) #define CAP_SET_SIZE (__CAP_BLKS * sizeof(__u32)) struct _cap_struct { + __u8 mutex; struct __user_cap_header_struct head; union { struct __user_cap_data_struct set; __u32 flat[NUMBER_OF_CAP_SETS]; - } u[_LINUX_CAPABILITY_U32S]; + } u[_LINUX_CAPABILITY_U32S_3]; + uid_t rootid; }; cap_t _fcaps_load(struct vfs_cap_data *rawvfscap, cap_t result, int bytes) -- 2.33.0