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

Function crcopysafe

freebsd/kern/kern_prot.c:2218–2237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2216}
2217
2218struct ucred *
2219crcopysafe(struct proc *p, struct ucred *cr)
2220{
2221 struct ucred *oldcred;
2222 int groups;
2223
2224 PROC_LOCK_ASSERT(p, MA_OWNED);
2225
2226 oldcred = p->p_ucred;
2227 while (cr->cr_agroups < oldcred->cr_agroups) {
2228 groups = oldcred->cr_agroups;
2229 PROC_UNLOCK(p);
2230 crextend(cr, groups);
2231 PROC_LOCK(p);
2232 oldcred = p->p_ucred;
2233 }
2234 crcopy(cr, oldcred);
2235
2236 return (oldcred);
2237}
2238
2239/*
2240 * Extend the passed in credential to hold n items.

Callers 11

sys_cap_enterFunction · 0.85
do_jail_attachFunction · 0.85
sys_setloginclassFunction · 0.85
kern_prot.cFile · 0.85
sys_seteuidFunction · 0.85
sys_setegidFunction · 0.85
kern_setgroupsFunction · 0.85
sys_setreuidFunction · 0.85
sys_setregidFunction · 0.85
sys_setresuidFunction · 0.85
sys_setresgidFunction · 0.85

Calls 2

crextendFunction · 0.85
crcopyFunction · 0.85

Tested by

no test coverage detected