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

Function crcopy

freebsd/kern/kern_prot.c:2098–2117  ·  view source on GitHub ↗

* Copy a ucred's contents from a template. Does not block. */

Source from the content-addressed store, hash-verified

2096 * Copy a ucred's contents from a template. Does not block.
2097 */
2098void
2099crcopy(struct ucred *dest, struct ucred *src)
2100{
2101
2102 KASSERT(dest->cr_ref == 1, ("crcopy of shared ucred"));
2103 bcopy(&src->cr_startcopy, &dest->cr_startcopy,
2104 (unsigned)((caddr_t)&src->cr_endcopy -
2105 (caddr_t)&src->cr_startcopy));
2106 crsetgroups(dest, src->cr_ngroups, src->cr_groups);
2107 uihold(dest->cr_uidinfo);
2108 uihold(dest->cr_ruidinfo);
2109 prison_hold(dest->cr_prison);
2110 loginclass_hold(dest->cr_loginclass);
2111#ifdef AUDIT
2112 audit_cred_copy(src, dest);
2113#endif
2114#ifdef MAC
2115 mac_cred_copy(src, dest);
2116#endif
2117}
2118
2119/*
2120 * Dup cred struct to a new held one.

Callers 9

sys_auditonFunction · 0.85
sys_setauidFunction · 0.85
sys_setauditFunction · 0.85
sys_setaudit_addrFunction · 0.85
sys___mac_set_procFunction · 0.85
lomac_thread_userretFunction · 0.85
crdupFunction · 0.85
crcopysafeFunction · 0.85
create_initFunction · 0.85

Calls 5

crsetgroupsFunction · 0.85
uiholdFunction · 0.85
prison_holdFunction · 0.85
audit_cred_copyFunction · 0.85
mac_cred_copyFunction · 0.85

Tested by

no test coverage detected