aboutsummaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2002-07-30 15:43:17 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2002-07-30 15:43:17 +0000
commit45ce708fb9758901980e06618b2eaeb8005ae348 (patch)
tree3d34515df190f7d3681263450c7224151ddc323f /sys/kern/kern_exec.c
parentd026fbec2d97da51dadc1cb032b44ba65ff0c0b8 (diff)
downloadsrc-45ce708fb9758901980e06618b2eaeb8005ae348.tar.gz
src-45ce708fb9758901980e06618b2eaeb8005ae348.zip
MFC sys/kern/kern_exec.c 1.178: Fix ordering of set-(user|group)-ID checks.
Notes
Notes: svn path=/releng/4.4/; revision=100952
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 0e546f71f9fe..e84027eaae7d 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -323,6 +323,8 @@ interpret:
vrele(p->p_tracep);
p->p_tracep = NULL;
}
+ /* Close any file descriptors 0..2 that reference procfs */
+ setugidsafety(p);
/* Make sure file descriptors 0..2 are in use. */
error = fdcheckstd(p);
if (error != 0)
@@ -335,7 +337,6 @@ interpret:
change_euid(p, attr.va_uid);
if (attr.va_mode & VSGID)
p->p_ucred->cr_gid = attr.va_gid;
- setugidsafety(p);
} else {
if (p->p_ucred->cr_uid == p->p_cred->p_ruid &&
p->p_ucred->cr_gid == p->p_cred->p_rgid)