Skip to content

Commit

Permalink
capabitlies: ns_capable can use the cap helpers rather than lsm call
Browse files Browse the repository at this point in the history
Just to reduce the number of places to change if we every change the LSM
hook, use the capability helpers internally when possible.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Serge E. Hallyn <serge.hallyn@canonical.com>
  • Loading branch information
eparis committed Jan 5, 2012
1 parent 105ddf4 commit d2a7009
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/capability.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ bool ns_capable(struct user_namespace *ns, int cap)
BUG();
}

if (security_capable(current_cred(), ns, cap) == 0) {
if (has_ns_capability(current, ns, cap)) {
current->flags |= PF_SUPERPRIV;
return true;
}
Expand Down

0 comments on commit d2a7009

Please sign in to comment.