Security: Typecast CAP_*_SET macros
Cast the CAP_*_SET macros to be of kernel_cap_t type to avoid compiler warnings. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
committed by
James Morris
parent
e52c1764f1
commit
780db6c104
@@ -365,12 +365,12 @@ typedef struct kernel_cap_struct {
|
|||||||
# error Fix up hand-coded capability macro initializers
|
# error Fix up hand-coded capability macro initializers
|
||||||
#else /* HAND-CODED capability initializers */
|
#else /* HAND-CODED capability initializers */
|
||||||
|
|
||||||
# define CAP_EMPTY_SET {{ 0, 0 }}
|
# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }})
|
||||||
# define CAP_FULL_SET {{ ~0, ~0 }}
|
# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }})
|
||||||
# define CAP_INIT_EFF_SET {{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}
|
# define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }})
|
||||||
# define CAP_FS_SET {{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } }
|
# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } })
|
||||||
# define CAP_NFSD_SET {{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
|
# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
|
||||||
CAP_FS_MASK_B1 } }
|
CAP_FS_MASK_B1 } })
|
||||||
|
|
||||||
#endif /* _LINUX_CAPABILITY_U32S != 2 */
|
#endif /* _LINUX_CAPABILITY_U32S != 2 */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user