diff options
Diffstat (limited to 'freebsd/lib/libcapsicum/capsicum_helpers.h')
-rw-r--r-- | freebsd/lib/libcapsicum/capsicum_helpers.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/freebsd/lib/libcapsicum/capsicum_helpers.h b/freebsd/lib/libcapsicum/capsicum_helpers.h index 60c894f3..d1c46e74 100644 --- a/freebsd/lib/libcapsicum/capsicum_helpers.h +++ b/freebsd/lib/libcapsicum/capsicum_helpers.h @@ -136,6 +136,35 @@ caph_enter(void) return (0); } +static __inline int +caph_rights_limit(int fd, const cap_rights_t *rights) +{ + + if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS) + return (-1); + + return (0); +} + +static __inline int +caph_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds) +{ + + if (cap_ioctls_limit(fd, cmds, ncmds) < 0 && errno != ENOSYS) + return (-1); + + return (0); +} + +static __inline int +caph_fcntls_limit(int fd, uint32_t fcntlrights) +{ + + if (cap_fcntls_limit(fd, fcntlrights) < 0 && errno != ENOSYS) + return (-1); + + return (0); +} static __inline int caph_enter_casper(void) |