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

Function getcredhostname

freebsd/kern/kern_jail.c:3109–3122  ·  view source on GitHub ↗

* Return the correct hostname (domainname, et al) for the passed credential. */

Source from the content-addressed store, hash-verified

3107 * Return the correct hostname (domainname, et al) for the passed credential.
3108 */
3109void
3110getcredhostname(struct ucred *cred, char *buf, size_t size)
3111{
3112 struct prison *pr;
3113
3114 /*
3115 * A NULL credential can be used to shortcut to the physical
3116 * system's hostname.
3117 */
3118 pr = (cred != NULL) ? cred->cr_prison : &prison0;
3119 mtx_lock(&pr->pr_mtx);
3120 strlcpy(buf, pr->pr_hostname, size);
3121 mtx_unlock(&pr->pr_mtx);
3122}
3123
3124void
3125getcreddomainname(struct ucred *cred, char *buf, size_t size)

Callers 1

corefile_openFunction · 0.85

Calls 3

mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70
strlcpyFunction · 0.50

Tested by

no test coverage detected