aboutsummaryrefslogtreecommitdiffstats
path: root/security/dummy.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/dummy.c')
-rw-r--r--security/dummy.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/security/dummy.c b/security/dummy.c
index c505122e22db..649326bf64ea 100644
--- a/security/dummy.c
+++ b/security/dummy.c
@@ -36,14 +36,19 @@ static int dummy_ptrace (struct task_struct *parent, struct task_struct *child)
36static int dummy_capget (struct task_struct *target, kernel_cap_t * effective, 36static int dummy_capget (struct task_struct *target, kernel_cap_t * effective,
37 kernel_cap_t * inheritable, kernel_cap_t * permitted) 37 kernel_cap_t * inheritable, kernel_cap_t * permitted)
38{ 38{
39 *effective = *inheritable = *permitted = 0;
40 if (target->euid == 0) { 39 if (target->euid == 0) {
41 *permitted |= (~0 & ~CAP_FS_MASK); 40 cap_set_full(*permitted);
42 *effective |= (~0 & ~CAP_TO_MASK(CAP_SETPCAP) & ~CAP_FS_MASK); 41 cap_set_init_eff(*effective);
42 } else {
43 cap_clear(*permitted);
44 cap_clear(*effective);
43 } 45 }
44 if (target->fsuid == 0) { 46
45 *permitted |= CAP_FS_MASK; 47 cap_clear(*inheritable);
46 *effective |= CAP_FS_MASK; 48
49 if (target->fsuid != 0) {
50 *permitted = cap_drop_fs_set(*permitted);
51 *effective = cap_drop_fs_set(*effective);
47 } 52 }
48 return 0; 53 return 0;
49} 54}