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

Function cap_rights_merge

freebsd/kern/subr_capability.c:340–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340cap_rights_t *
341cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src)
342{
343 unsigned int i, n;
344
345 assert(CAPVER(dst) == CAP_RIGHTS_VERSION_00);
346 assert(CAPVER(src) == CAP_RIGHTS_VERSION_00);
347 assert(CAPVER(dst) == CAPVER(src));
348 assert(cap_rights_is_valid(src));
349 assert(cap_rights_is_valid(dst));
350
351 n = CAPARSIZE(dst);
352 assert(n >= CAPARSIZE_MIN && n <= CAPARSIZE_MAX);
353
354 for (i = 0; i < n; i++)
355 dst->cr_rights[i] |= src->cr_rights[i];
356
357 assert(cap_rights_is_valid(src));
358 assert(cap_rights_is_valid(dst));
359
360 return (dst);
361}
362
363cap_rights_t *
364cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src)

Callers

nothing calls this directly

Calls 1

cap_rights_is_validFunction · 0.85

Tested by

no test coverage detected