diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2002-07-27 18:06:49 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2002-07-27 18:06:49 +0000 |
| commit | d06c0d4d40794c0ce16c3c8ac8616938250273c4 (patch) | |
| tree | abf3460c1415aaac7292a1a9b0cd24a5e4142858 /sys/kern/kern_exec.c | |
| parent | ce39e722ec464569d9cdf4097b3a763efab7133b (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_exec.c')
| -rw-r--r-- | sys/kern/kern_exec.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2ed383991037..df6bf3af8da3 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -145,6 +145,7 @@ execve(td, uap) struct vnode *tracevp = NULL; #endif struct vnode *textvp = NULL; + int credential_changing; imgp = &image_params; @@ -378,8 +379,13 @@ interpret: * the process is being traced. */ oldcred = p->p_ucred; - if ((((attr.va_mode & VSUID) && oldcred->cr_uid != attr.va_uid) || - ((attr.va_mode & VSGID) && oldcred->cr_gid != attr.va_gid)) && + credential_changing = 0; + credential_changing |= (attr.va_mode & VSUID) && oldcred->cr_uid != + attr.va_uid; + credential_changing |= (attr.va_mode & VSGID) && oldcred->cr_gid != + attr.va_gid; + + if (credential_changing && (imgp->vp->v_mount->mnt_flag & MNT_NOSUID) == 0 && (p->p_flag & P_TRACED) == 0) { /* |
