History

capabilities: delete all CAP_INIT macros

The CAP_INIT macros of INH, BSET, and EFF made sense at one point in time, but now days they aren't helping. Just open code the logic in the init_cred.

Eric Paris committed 15 years ago

Commit a3232d21 parent 5163b583 files · +3 −13Browse files

Unified · Split

3 files
  1. include/linux/capability.h +0 −3
  2. include/linux/init_task.h +0 −7
  3. kernel/cred.c +3 −3
include/linux/capability.h+0−3
@@ -421,9 +421,6 @@ extern const kernel_cap_t __cap_init_eff_set; · 420 unmodified lines
421421
422422 #endif /* _KERNEL_CAPABILITY_U32S != 2 */
423423
424−#define CAP_INIT_INH_SET CAP_EMPTY_SET
425−#define CAP_INIT_EFF_SET CAP_FULL_SET
426−
427424 # define cap_clear(c) do { (c) = __cap_empty_set; } while (0)
428425
429426 #define cap_raise(c, flag) ((c).cap[CAP_TO_INDEX(flag)] |= CAP_TO_MASK(flag))
include/linux/init_task.h+0−7
@@ -83,13 +83,6 @@ extern struct group_info init_groups; · 82 unmodified lines
8383 #define INIT_IDS
8484 #endif
8585
86−/*
87− * Because of the reduced scope of CAP_SETPCAP when filesystem
88− * capabilities are in effect, it is safe to allow CAP_SETPCAP to
89− * be available in the default configuration.
90− */
91−# define CAP_INIT_BSET CAP_FULL_SET
92−
9386 #ifdef CONFIG_RCU_BOOST
9487 #define INIT_TASK_RCU_BOOST() \
9588 .rcu_boost_mutex = NULL,
kernel/cred.c+3−3
@@ -49,10 +49,10 @@ struct cred init_cred = { · 48 unmodified lines
4949 .magic = CRED_MAGIC,
5050 #endif
5151 .securebits = SECUREBITS_DEFAULT,
52− .cap_inheritable = CAP_INIT_INH_SET,
52+ .cap_inheritable = CAP_EMPTY_SET,
5353 .cap_permitted = CAP_FULL_SET,
54− .cap_effective = CAP_INIT_EFF_SET,
55− .cap_bset = CAP_INIT_BSET,
54+ .cap_effective = CAP_FULL_SET,
55+ .cap_bset = CAP_FULL_SET,
5656 .user = INIT_USER,
5757 .group_info = &init_groups,
5858 #ifdef CONFIG_KEYS