aboutsummaryrefslogtreecommitdiff
path: root/include/linux/capability.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-08-15 15:32:13 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-15 15:32:13 -0700
commit71ef2a46fce43042a60d7ccbf55ecbd789c03c2e (patch)
tree247c3e25958ff362b8a7b5b735a1e7d2ef6842c7 /include/linux/capability.h
parentd121db94eb50b29a202b5f6a8671cbebdf2c4142 (diff)
parent5cd9c58fbe9ec92b45b27e131719af4f2bd9eb40 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: security: Fix setting of PF_SUPERPRIV by __capable()
Diffstat (limited to 'include/linux/capability.h')
-rw-r--r--include/linux/capability.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 02673846d20..9d1fe30b6f6 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -503,8 +503,19 @@ extern const kernel_cap_t __cap_init_eff_set;
kernel_cap_t cap_set_effective(const kernel_cap_t pE_new);
-int capable(int cap);
-int __capable(struct task_struct *t, int cap);
+/**
+ * has_capability - Determine if a task has a superior capability available
+ * @t: The task in question
+ * @cap: The capability to be tested for
+ *
+ * Return true if the specified task has the given superior capability
+ * currently in effect, false if not.
+ *
+ * Note that this does not set PF_SUPERPRIV on the task.
+ */
+#define has_capability(t, cap) (security_capable((t), (cap)) == 0)
+
+extern int capable(int cap);
#endif /* __KERNEL__ */