Lines Matching full:cap

269  * @cap: The capability to be tested for
277 struct user_namespace *ns, int cap) in has_ns_capability() argument
282 ret = security_capable(__task_cred(t), ns, cap, CAP_OPT_NONE); in has_ns_capability()
293 * @cap: The capability to be tested for
302 struct user_namespace *ns, int cap) in has_ns_capability_noaudit() argument
307 ret = security_capable(__task_cred(t), ns, cap, CAP_OPT_NOAUDIT); in has_ns_capability_noaudit()
317 * @cap: The capability to be tested for
325 bool has_capability_noaudit(struct task_struct *t, int cap) in has_capability_noaudit() argument
327 return has_ns_capability_noaudit(t, &init_user_ns, cap); in has_capability_noaudit()
332 int cap, in ns_capable_common() argument
337 if (unlikely(!cap_valid(cap))) { in ns_capable_common()
338 pr_crit("capable() called with invalid cap=%u\n", cap); in ns_capable_common()
342 capable = security_capable(current_cred(), ns, cap, opts); in ns_capable_common()
353 * @cap: The capability to be tested for
361 bool ns_capable(struct user_namespace *ns, int cap) in ns_capable() argument
363 return ns_capable_common(ns, cap, CAP_OPT_NONE); in ns_capable()
371 * @cap: The capability to be tested for
379 bool ns_capable_noaudit(struct user_namespace *ns, int cap) in ns_capable_noaudit() argument
381 return ns_capable_common(ns, cap, CAP_OPT_NOAUDIT); in ns_capable_noaudit()
390 * @cap: The capability to be tested for
398 bool ns_capable_setid(struct user_namespace *ns, int cap) in ns_capable_setid() argument
400 return ns_capable_common(ns, cap, CAP_OPT_INSETID); in ns_capable_setid()
406 * @cap: The capability to be tested for
414 bool capable(int cap) in capable() argument
416 return ns_capable(&init_user_ns, cap); in capable()
425 * @cap: The capability to be tested for
434 int cap) in file_ns_capable() argument
437 if (WARN_ON_ONCE(!cap_valid(cap))) in file_ns_capable()
440 if (security_capable(file->f_cred, ns, cap, CAP_OPT_NONE) == 0) in file_ns_capable()
467 * @cap: The capability in question
474 const struct inode *inode, int cap) in capable_wrt_inode_uidgid() argument
478 return ns_capable(ns, cap) && in capable_wrt_inode_uidgid()