MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _cap_check

Function _cap_check

freebsd/kern/sys_capability.c:157–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155MALLOC_DECLARE(M_FILECAPS);
156
157static inline int
158_cap_check(const cap_rights_t *havep, const cap_rights_t *needp,
159 enum ktr_cap_fail_type type)
160{
161
162 if (!cap_rights_contains(havep, needp)) {
163#ifdef KTRACE
164 if (KTRPOINT(curthread, KTR_CAPFAIL))
165 ktrcapfail(type, needp, havep);
166#endif
167 return (ENOTCAPABLE);
168 }
169 return (0);
170}
171
172/*
173 * Test whether a capability grants the requested rights.

Callers 2

cap_checkFunction · 0.85
kern_cap_rights_limitFunction · 0.85

Calls 2

cap_rights_containsFunction · 0.85
ktrcapfailFunction · 0.85

Tested by

no test coverage detected