Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/capsicum.h
| Show All 38 Lines | |||||
| #ifndef _SYS_CAPSICUM_H_ | #ifndef _SYS_CAPSICUM_H_ | ||||
| #define _SYS_CAPSICUM_H_ | #define _SYS_CAPSICUM_H_ | ||||
| #include <sys/param.h> | #include <sys/param.h> | ||||
| #include <sys/caprights.h> | #include <sys/caprights.h> | ||||
| #include <sys/file.h> | #include <sys/file.h> | ||||
| #include <sys/fcntl.h> | #include <sys/fcntl.h> | ||||
| #include <sys/ktrace.h> | |||||
| #ifndef _KERNEL | #ifndef _KERNEL | ||||
| #include <stdbool.h> | #include <stdbool.h> | ||||
| #endif | #endif | ||||
| #define CAPRIGHT(idx, bit) ((1ULL << (57 + (idx))) | (bit)) | #define CAPRIGHT(idx, bit) ((1ULL << (57 + (idx))) | (bit)) | ||||
| /* | /* | ||||
| ▲ Show 20 Lines • Show All 358 Lines • ▼ Show 20 Lines | |||||
| bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); | bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little); | ||||
| #endif | #endif | ||||
| __END_DECLS | __END_DECLS | ||||
| #ifdef _KERNEL | #ifdef _KERNEL | ||||
| #include <sys/systm.h> | #include <sys/systm.h> | ||||
| #ifdef KTRACE | |||||
| #define CAP_TRACING(td) KTRPOINT((td), KTR_CAPFAIL) | |||||
| #else | |||||
| #define CAP_TRACING(td) 0 | |||||
| #endif | |||||
| #define IN_CAPABILITY_MODE(td) (((td)->td_ucred->cr_flags & CRED_FLAG_CAPMODE) != 0) | #define IN_CAPABILITY_MODE(td) (((td)->td_ucred->cr_flags & CRED_FLAG_CAPMODE) != 0) | ||||
| struct filedesc; | struct filedesc; | ||||
| struct filedescent; | struct filedescent; | ||||
| /* | /* | ||||
| * Test whether a capability grants the requested rights. | * Test whether a capability grants the requested rights. | ||||
| ▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines | |||||