]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/capability.h
security: Fix setting of PF_SUPERPRIV by __capable()
[linux-2.6-omap-h63xx.git] / include / linux / capability.h
index fa830f8de0328d6cea2e73c7f66352e9ab6f8871..9d1fe30b6f6c1226b7fe6e6d37937c2d50be70ac 100644 (file)
@@ -501,8 +501,21 @@ extern const kernel_cap_t __cap_empty_set;
 extern const kernel_cap_t __cap_full_set;
 extern const kernel_cap_t __cap_init_eff_set;
 
-int capable(int cap);
-int __capable(struct task_struct *t, int cap);
+kernel_cap_t cap_set_effective(const kernel_cap_t pE_new);
+
+/**
+ * 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__ */