summaryrefslogtreecommitdiff
path: root/kernel/capability.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-05-19 08:51:57 (GMT)
committerJames Morris <jmorris@namei.org>2011-05-19 08:51:57 (GMT)
commit12a5a2621b1ee14d32beca35304d7c6076a58815 (patch)
tree213e13f99de690b3c4a510f504393b63ada626bd /kernel/capability.c
parente77dc3460fa59be5759e9327ad882868eee9d61b (diff)
parent61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf (diff)
downloadlinux-3.10-12a5a2621b1ee14d32beca35304d7c6076a58815.zip
linux-3.10-12a5a2621b1ee14d32beca35304d7c6076a58815.tar.gz
linux-3.10-12a5a2621b1ee14d32beca35304d7c6076a58815.tar.bz2
Merge branch 'master' into next
Conflicts: include/linux/capability.h Manually resolve merge conflict w/ thanks to Stephen Rothwell. Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel/capability.c')
-rw-r--r--kernel/capability.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/capability.c b/kernel/capability.c
index 14ea4210..283c529 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -395,3 +395,15 @@ bool task_ns_capable(struct task_struct *t, int cap)
return ns_capable(task_cred_xxx(t, user)->user_ns, cap);
}
EXPORT_SYMBOL(task_ns_capable);
+
+/**
+ * nsown_capable - Check superior capability to one's own user_ns
+ * @cap: The capability in question
+ *
+ * Return true if the current task has the given superior capability
+ * targeted at its own user namespace.
+ */
+bool nsown_capable(int cap)
+{
+ return ns_capable(current_user_ns(), cap);
+}