From 4f5a4612d3555a0741db1d8359d77f9fbd703776 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 2 Dec 2001 15:22:56 +0000 Subject: [PATCH] o Uniformly copy uap arguments into local variables before grabbing giant, and make whitespace more consistent around giant-frobbing. --- sys/kern/kern_prot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index df0dd41b1ef1..01216bd8d5dd 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -642,7 +642,6 @@ setgid(td, uap) int error; gid = uap->gid; - mtx_lock(&Giant); error = 0; oldcred = p->p_ucred; @@ -773,8 +772,8 @@ setgroups(td, uap) u_int ngrp; int error; - mtx_lock(&Giant); ngrp = uap->gidsetsize; + mtx_lock(&Giant); oldcred = p->p_ucred; if ((error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0) goto done2; @@ -1007,7 +1006,6 @@ setresgid(td, uap) egid = uap->egid; rgid = uap->rgid; sgid = uap->sgid; - mtx_lock(&Giant); oldcred = p->p_ucred; if (((rgid != (gid_t)-1 && rgid != oldcred->cr_rgid &&