Use getcredhostuuid instead of accessing the prison directly.
Approved by: bz (mentor)
This commit is contained in:
parent
4798e07722
commit
dbcc94be36
@ -676,16 +676,12 @@ nfscl_getcl(vnode_t vp, struct ucred *cred, NFSPROC_T *p,
|
|||||||
struct nfsclclient *newclp = NULL;
|
struct nfsclclient *newclp = NULL;
|
||||||
struct nfscllockowner *lp, *nlp;
|
struct nfscllockowner *lp, *nlp;
|
||||||
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp));
|
struct nfsmount *nmp = VFSTONFS(vnode_mount(vp));
|
||||||
struct prison *pr;
|
|
||||||
char uuid[HOSTUUIDLEN];
|
char uuid[HOSTUUIDLEN];
|
||||||
int igotlock = 0, error, trystalecnt, clidinusedelay, i;
|
int igotlock = 0, error, trystalecnt, clidinusedelay, i;
|
||||||
u_int16_t idlen = 0;
|
u_int16_t idlen = 0;
|
||||||
|
|
||||||
if (cred != NULL) {
|
if (cred != NULL) {
|
||||||
pr = cred->cr_prison;
|
getcredhostuuid(cred, uuid, sizeof uuid);
|
||||||
mtx_lock(&pr->pr_mtx);
|
|
||||||
strlcpy(uuid, pr->pr_uuid, sizeof uuid);
|
|
||||||
mtx_unlock(&pr->pr_mtx);
|
|
||||||
idlen = strlen(uuid);
|
idlen = strlen(uuid);
|
||||||
if (idlen > 0)
|
if (idlen > 0)
|
||||||
idlen += sizeof (u_int64_t);
|
idlen += sizeof (u_int64_t);
|
||||||
|
Loading…
Reference in New Issue
Block a user