capsicum: introduce cap_rights_is_empty FunctionBefore this commit, we only had the capability to check if a specificcapability was set (using cap_rights_is_set function). However, therewas no ef
capsicum: introduce cap_rights_is_empty FunctionBefore this commit, we only had the capability to check if a specificcapability was set (using cap_rights_is_set function). However, therewas no efficient method to determine if a cap_rights_t structure doesn'tcontain any capability. The cap_rights_is_empty function addressesthis gap.PR: 275330Reported by: [email protected]Reviewed by: emaste, markjDifferential Revision: https://reviews.freebsd.org/D42780(cherry picked from commit a7100ae23aca07976926bd8d50223c45149f65d6)
show more ...
libc: Remove empty comments in Symbol.mapThese were left over from $FreeBSD$ removal.Reviewed by: emasteDifferential Revision: https://reviews.freebsd.org/D42612(cherry picked from commit 1ca6
libc: Remove empty comments in Symbol.mapThese were left over from $FreeBSD$ removal.Reviewed by: emasteDifferential Revision: https://reviews.freebsd.org/D42612(cherry picked from commit 1ca63a8219b88b752b064d19bd3428c61dbcf1f9)
Remove $FreeBSD$: two-line nroff patternRemove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
Remove $FreeBSD$: one-line sh patternRemove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
Remove $FreeBSD$: one-line .h patternRemove /^\s*\*+\s*\$FreeBSD\$.*$\n/
Remove "All Rights Reserved" from FreeBSD Foundation libc copyrightsAs per the updated FreeBSD copyright template. These were unambiguouscases where the Foundation was the only listed copyright h
Remove "All Rights Reserved" from FreeBSD Foundation libc copyrightsAs per the updated FreeBSD copyright template. These were unambiguouscases where the Foundation was the only listed copyright holder.Sponsored by: The FreeBSD Foundation
Fix a few mandoc issues- skipping paragraph macro: Pp after Sh- sections out of conventional order: Sh EXAMPLES- whitespace at end of input line- normalizing date format
libcasper(3): Document HISTORY within the manpagesReviewed by: bcr (mentor)Approved by: bcr (mentor)MFC after: 7 daysDifferential Revision: https://reviews.freebsd.org/D24695
Replace dot-dot relative pathing with SRCTOP-relative paths where possibleThis reduces build output, need for recalculating paths, and makes it clearerwhich paths are relative to what areas in the
Replace dot-dot relative pathing with SRCTOP-relative paths where possibleThis reduces build output, need for recalculating paths, and makes it clearerwhich paths are relative to what areas in the source tree. The change inperformance over a locally mounted UFS filesystem was negligible in my testing,but this may more positively impact other filesystems like NFS.LIBC_SRCTOP was left alone so Juniper (and other users) can continue tomanipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) asinclude Makefiles with custom options.Discussed with: marcel, sjgMFC after: 1 weekReviewed by: emasteSponsored by: Dell EMC IsilonDifferential Revision: https://reviews.freebsd.org/D9207
use .Mt to mark up email addresses consistently (part4)PR: 191174Submitted by: Franco Fichtner <franco at lastsummer.de>
Update system man pages for s/capability.h/capsicum.h/.MFC after: 3 weeks
Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}if not already defined. This allows building libc from outside oflib/libc using a reach-over makefile.A typical use-case is to
Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}if not already defined. This allows building libc from outside oflib/libc using a reach-over makefile.A typical use-case is to build a standard ILP32 version and a COMPAT32version in a single iteration by building the COMPAT32 version using areach-over makefile.Obtained from: Juniper Networks, Inc.
- Add manual pages for capability rights (rights(4)), cap_rights_init(3) family of functions and cap_rights_get(3) function.- Update remaining Capsicum-related manual pages.Reviewed by: bdrewery
- Add manual pages for capability rights (rights(4)), cap_rights_init(3) family of functions and cap_rights_get(3) function.- Update remaining Capsicum-related manual pages.Reviewed by: bdreweryMFC after: 3 days
Change the cap_rights_t type from uint64_t to a structure that we can extendin the future in a backward compatible (API and ABI) way.The cap_rights_t represents capability rights. We used to use o
Change the cap_rights_t type from uint64_t to a structure that we can extendin the future in a backward compatible (API and ABI) way.The cap_rights_t represents capability rights. We used to use one bit torepresent one right, but we are running out of spare bits. Currently the newstructure provides place for 114 rights (so 50 more than the previouscap_rights_t), but it is possible to grow the structure to hold at least 285rights, although we can make it even larger if 285 rights won't be enough.The structure definition looks like this: struct cap_rights { uint64_t cr_rights[CAP_RIGHTS_VERSION + 2]; };The initial CAP_RIGHTS_VERSION is 0.The top two bits in the first element of the cr_rights[] array contain totalnumber of elements in the array - 2. This means if those two bits are equal to0, we have 2 array elements.The top two bits in all remaining array elements should be 0.The next five bits in all array elements contain array index. Only one bit isused and bit position in this five-bits range defines array index. This meansthere can be at most five array elements in the future.To define new right the CAPRIGHT() macro must be used. The macro takes twoarguments - an array index and a bit to set, eg. #define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL)We still support aliases that combine few rights, but the rights have to belongto the same array element, eg: #define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL) #define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL) #define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP)There is new API to manage the new cap_rights_t structure: cap_rights_t *cap_rights_init(cap_rights_t *rights, ...); void cap_rights_set(cap_rights_t *rights, ...); void cap_rights_clear(cap_rights_t *rights, ...); bool cap_rights_is_set(const cap_rights_t *rights, ...); bool cap_rights_is_valid(const cap_rights_t *rights); void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src); void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src); bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);Capability rights to the cap_rights_init(), cap_rights_set(),cap_rights_clear() and cap_rights_is_set() functions are provided byseparating them with commas, eg: cap_rights_t rights; cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);There is no need to terminate the list of rights, as those functions areactually macros that take care of the termination, eg: #define cap_rights_set(rights, ...) \ __cap_rights_set((rights), __VA_ARGS__, 0ULL) void __cap_rights_set(cap_rights_t *rights, ...);Thanks to using one bit as an array index we can assert in those functions thatthere are no two rights belonging to different array elements providedtogether. For example this is illegal and will be detected, because CAP_LOOKUPbelongs to element 0 and CAP_PDKILL to element 1: cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);Providing several rights that belongs to the same array's element this way iscorrect, but is not advised. It should only be used for aliases definition.This commit also breaks compatibility with some existing Capsicum system calls,but I see no other way to do that. This should be fine as Capsicum is stillexperimental and this change is not going to 9.x.Sponsored by: The FreeBSD Foundation