003 File Manager
Current Path:
/usr/src/contrib/capsicum-test
usr
/
src
/
contrib
/
capsicum-test
/
📁
..
📄
.gitignore
(235 B)
📄
CONTRIBUTING.md
(880 B)
📄
GNUmakefile
(2.22 KB)
📄
LICENSE
(1.4 KB)
📄
README.md
(2.7 KB)
📄
capability-fd-pair.cc
(5.52 KB)
📄
capability-fd.cc
(42.15 KB)
📄
capmode.cc
(19.24 KB)
📄
capsicum-freebsd.h
(1.97 KB)
📄
capsicum-linux.h
(1.17 KB)
📄
capsicum-rights.h
(2.86 KB)
📄
capsicum-test-main.cc
(4.23 KB)
📄
capsicum-test.cc
(2.63 KB)
📄
capsicum-test.h
(9.9 KB)
📄
capsicum.h
(4.49 KB)
📄
fcntl.cc
(14.48 KB)
📄
fexecve.cc
(6.08 KB)
📄
ioctl.cc
(6.93 KB)
📄
linux.cc
(48.75 KB)
📄
makefile
(1.59 KB)
📄
mini-me.c
(1.04 KB)
📄
mqueue.cc
(3.24 KB)
📄
openat.cc
(14.52 KB)
📄
overhead.cc
(1.28 KB)
📄
procdesc.cc
(26.95 KB)
📄
rename.cc
(1.59 KB)
📄
sctp.cc
(7.14 KB)
📄
select.cc
(4 KB)
📄
showrights
(4.81 KB)
📄
smoketest.c
(4.86 KB)
📄
socket.cc
(10.56 KB)
📄
syscalls.h
(8.36 KB)
📄
sysctl.cc
(403 B)
📄
waittest.c
(1 KB)
Editing: capsicum-rights.h
#ifndef __CAPSICUM_RIGHTS_H__ #define __CAPSICUM_RIGHTS_H__ #ifdef __cplusplus extern "C" { #endif #ifdef __FreeBSD__ #include <sys/param.h> #if __FreeBSD_version >= 1100014 || \ (__FreeBSD_version >= 1001511 && __FreeBSD_version < 1100000) #include <sys/capsicum.h> #else #include <sys/capability.h> #endif #endif #ifdef __linux__ #include <linux/capsicum.h> #endif #ifdef __cplusplus } #endif #ifndef CAP_RIGHTS_VERSION /************************************************************ * Capsicum compatibility layer: implement new (FreeBSD10.x) * rights manipulation API in terms of original (FreeBSD9.x) * functionality. ************************************************************/ #include <stdarg.h> #include <stdbool.h> /* Rights manipulation macros/functions. * Note that these use variadic macros, available in C99 / C++11 (and * also in earlier gcc versions). */ #define cap_rights_init(rights, ...) _cap_rights_init((rights), __VA_ARGS__, 0ULL) #define cap_rights_set(rights, ...) _cap_rights_set((rights), __VA_ARGS__, 0ULL) #define cap_rights_clear(rights, ...) _cap_rights_clear((rights), __VA_ARGS__, 0ULL) #define cap_rights_is_set(rights, ...) _cap_rights_is_set((rights), __VA_ARGS__, 0ULL) inline cap_rights_t* _cap_rights_init(cap_rights_t *rights, ...) { va_list ap; cap_rights_t right; *rights = 0; va_start(ap, rights); while (true) { right = va_arg(ap, cap_rights_t); *rights |= right; if (right == 0) break; } va_end(ap); return rights; } inline cap_rights_t* _cap_rights_set(cap_rights_t *rights, ...) { va_list ap; cap_rights_t right; va_start(ap, rights); while (true) { right = va_arg(ap, cap_rights_t); *rights |= right; if (right == 0) break; } va_end(ap); return rights; } inline cap_rights_t* _cap_rights_clear(cap_rights_t *rights, ...) { va_list ap; cap_rights_t right; va_start(ap, rights); while (true) { right = va_arg(ap, cap_rights_t); *rights &= ~right; if (right == 0) break; } va_end(ap); return rights; } inline bool _cap_rights_is_set(const cap_rights_t *rights, ...) { va_list ap; cap_rights_t right; cap_rights_t accumulated = 0; va_start(ap, rights); while (true) { right = va_arg(ap, cap_rights_t); accumulated |= right; if (right == 0) break; } va_end(ap); return (accumulated & *rights) == accumulated; } inline bool _cap_rights_is_valid(const cap_rights_t *rights) { return true; } inline cap_rights_t* cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src) { *dst |= *src; return dst; } inline cap_rights_t* cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src) { *dst &= ~(*src); return dst; } inline bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little) { return ((*big) & (*little)) == (*little); } #endif /* old/new style rights manipulation */ #endif /*__CAPSICUM_RIGHTS_H__*/
Upload File
Create Folder