diff options
| author | Chris Wright <chrisw@osdl.org> | 2005-01-03 21:54:13 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-03 21:54:13 -0800 |
| commit | d3270a94d8da4d8eecfa54a397d530e36c8df134 (patch) | |
| tree | 92d8d764fef23f10658f6f70dd663a95ef9fa727 /security | |
| parent | f14847ec19fc3fe1f70cb37893f2ab493da8a27e (diff) | |
[PATCH] track capabilities in default dummy security module code
Switch dummy logic around to set cap_* bits during exec and set*uid based
on basic uid check. Then check cap_* bits during capable() (rather than
doing basic uid check). This ensures that capability bits are properly
initialized in case the capability module is later loaded.
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security')
| -rw-r--r-- | security/dummy.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/security/dummy.c b/security/dummy.c index 53e496ec2213..b190ca6cb8ca 100644 --- a/security/dummy.c +++ b/security/dummy.c @@ -74,11 +74,8 @@ static int dummy_acct (struct file *file) static int dummy_capable (struct task_struct *tsk, int cap) { - if (cap_is_fs_cap (cap) ? tsk->fsuid == 0 : tsk->euid == 0) - /* capability granted */ + if (cap_raised (tsk->cap_effective, cap)) return 0; - - /* capability denied */ return -EPERM; } @@ -183,6 +180,7 @@ static int dummy_bprm_alloc_security (struct linux_binprm *bprm) static void dummy_bprm_free_security (struct linux_binprm *bprm) { + dummy_capget(current, ¤t->cap_effective, ¤t->cap_inheritable, ¤t->cap_permitted); return; } @@ -558,6 +556,7 @@ static int dummy_task_setuid (uid_t id0, uid_t id1, uid_t id2, int flags) static int dummy_task_post_setuid (uid_t id0, uid_t id1, uid_t id2, int flags) { + dummy_capget(current, ¤t->cap_effective, ¤t->cap_inheritable, ¤t->cap_permitted); return 0; } |
