diff options
| author | 2008-08-26 10:25:59 +0200 | |
|---|---|---|
| committer | 2008-08-26 10:25:59 +0200 | |
| commit | 3cf430b0636045dc524759a0852293ba037732a7 (patch) | |
| tree | 2c4e03f9028dc23ab4e6ca5a3a5a263af397984f /kernel/capability.c | |
| parent | wait_task_inactive: "improve" the returned value for ->nvcsw == 0 (diff) | |
| parent | Fix oops in acer_wmi driver (acer_wmi_init) (diff) | |
Merge branch 'linus' into sched/devel
Diffstat (limited to 'kernel/capability.c')
| -rw-r--r-- | kernel/capability.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/capability.c b/kernel/capability.c index 0101e847603e..33e51e78c2d8 100644 --- a/kernel/capability.c +++ b/kernel/capability.c @@ -486,17 +486,22 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data) return ret; } -int __capable(struct task_struct *t, int cap) +/** + * capable - Determine if the current task has a superior capability in effect + * @cap: The capability to be tested for + * + * Return true if the current task has the given superior capability currently + * available for use, false if not. + * + * This sets PF_SUPERPRIV on the task if the capability is available on the + * assumption that it's about to be used. + */ +int capable(int cap) { - if (security_capable(t, cap) == 0) { - t->flags |= PF_SUPERPRIV; + if (has_capability(current, cap)) { + current->flags |= PF_SUPERPRIV; return 1; } return 0; } - -int capable(int cap) -{ - return __capable(current, cap); -} EXPORT_SYMBOL(capable); |
