Skip to content

Commit

Permalink
Security: Typecast CAP_*_SET macros
Browse files Browse the repository at this point in the history
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: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Howells authored and Linus Torvalds committed Apr 29, 2008
1 parent 7bf570d commit 25f2ea9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/linux/capability.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@ typedef struct kernel_cap_struct {
# error Fix up hand-coded capability macro initializers
#else /* HAND-CODED capability initializers */

# define CAP_EMPTY_SET {{ 0, 0 }}
# define CAP_FULL_SET {{ ~0, ~0 }}
# define CAP_INIT_EFF_SET {{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}
# define CAP_FS_SET {{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } }
# define CAP_NFSD_SET {{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
CAP_FS_MASK_B1 } }
# define CAP_EMPTY_SET ((kernel_cap_t){{ 0, 0 }})
# define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }})
# define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }})
# define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } })
# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \
CAP_FS_MASK_B1 } })

#endif /* _LINUX_CAPABILITY_U32S != 2 */

Expand Down

0 comments on commit 25f2ea9

Please sign in to comment.