mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
capabilities: remove all _real_ interfaces
The name security_real_capable and security_real_capable_noaudit just don't make much sense to me. Convert them to use security_capable and security_capable_noaudit. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Serge E. Hallyn <serge.hallyn@canonical.com>
This commit is contained in:
parent
c7eba4a975
commit
2920a8409d
3 changed files with 15 additions and 52 deletions
|
@ -298,7 +298,11 @@ error:
|
|||
*/
|
||||
bool has_capability(struct task_struct *t, int cap)
|
||||
{
|
||||
int ret = security_real_capable(t, &init_user_ns, cap);
|
||||
int ret;
|
||||
|
||||
rcu_read_lock();
|
||||
ret = security_capable(__task_cred(t), &init_user_ns, cap);
|
||||
rcu_read_unlock();
|
||||
|
||||
return (ret == 0);
|
||||
}
|
||||
|
@ -317,7 +321,11 @@ bool has_capability(struct task_struct *t, int cap)
|
|||
bool has_ns_capability(struct task_struct *t,
|
||||
struct user_namespace *ns, int cap)
|
||||
{
|
||||
int ret = security_real_capable(t, ns, cap);
|
||||
int ret;
|
||||
|
||||
rcu_read_lock();
|
||||
ret = security_capable(__task_cred(t), ns, cap);
|
||||
rcu_read_unlock();
|
||||
|
||||
return (ret == 0);
|
||||
}
|
||||
|
@ -335,7 +343,11 @@ bool has_ns_capability(struct task_struct *t,
|
|||
*/
|
||||
bool has_capability_noaudit(struct task_struct *t, int cap)
|
||||
{
|
||||
int ret = security_real_capable_noaudit(t, &init_user_ns, cap);
|
||||
int ret;
|
||||
|
||||
rcu_read_lock();
|
||||
ret = security_capable_noaudit(__task_cred(t), &init_user_ns, cap);
|
||||
rcu_read_unlock();
|
||||
|
||||
return (ret == 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue