|author||Eric Paris <firstname.lastname@example.org>||2012-01-03 12:25:15 -0500|
|committer||Eric Paris <email@example.com>||2012-01-05 18:52:59 -0500|
capabilities: remove task_ns_* functions
task_ in the front of a function, in the security subsystem anyway, means to me at least, that we are operating with that task as the subject of the security decision. In this case what it means is that we are using current as the subject but we use the task to get the right namespace. Who in the world would ever realize that's what task_ns_capability means just by the name? This patch eliminates the task_ns functions entirely and uses the has_ns_capability function instead. This means we explicitly open code the ns in question in the caller. I think it makes the caller a LOT more clear what is going on. Signed-off-by: Eric Paris <firstname.lastname@example.org> Acked-by: Serge E. Hallyn <email@example.com>
Diffstat (limited to 'kernel/capability.c')
1 files changed, 0 insertions, 14 deletions
diff --git a/kernel/capability.c b/kernel/capability.c
index 47626446c39..74fb3b60304 100644
@@ -409,20 +409,6 @@ bool capable(int cap)
- * task_ns_capable - Determine whether current task has a superior
- * capability targeted at a specific task's user namespace.
- * @t: The task whose user namespace is targeted.
- * @cap: The capability in question.
- * Return true if it does, false otherwise.
-bool task_ns_capable(struct task_struct *t, int cap)
- return ns_capable(task_cred_xxx(t, user)->user_ns, cap);
* nsown_capable - Check superior capability to one's own user_ns
* @cap: The capability in question