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

Function crget

freebsd/kern/kern_prot.c:1989–2007  ·  view source on GitHub ↗

* Allocate a zeroed cred structure. */

Source from the content-addressed store, hash-verified

1987 * Allocate a zeroed cred structure.
1988 */
1989struct ucred *
1990crget(void)
1991{
1992 struct ucred *cr;
1993
1994 cr = malloc(sizeof(*cr), M_CRED, M_WAITOK | M_ZERO);
1995 mtx_init(&cr->cr_mtx, "cred", NULL, MTX_DEF);
1996 cr->cr_ref = 1;
1997#ifdef AUDIT
1998 audit_cred_init(cr);
1999#endif
2000#ifdef MAC
2001 mac_cred_init(cr);
2002#endif
2003 cr->cr_groups = cr->cr_smallgroups;
2004 cr->cr_agroups =
2005 sizeof(cr->cr_smallgroups) / sizeof(cr->cr_smallgroups[0]);
2006 return (cr);
2007}
2008
2009/*
2010 * Claim another reference to a ucred structure.

Callers 15

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

Calls 4

mallocFunction · 0.85
mtx_initFunction · 0.85
audit_cred_initFunction · 0.85
mac_cred_initFunction · 0.85

Tested by

no test coverage detected