diff options
author | dg <dg@FreeBSD.org> | 1995-04-15 03:20:31 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-04-15 03:20:31 +0000 |
commit | b7ad7fee08d92c010db8d3a350b96a2607304a07 (patch) | |
tree | 0f4cddcf07ad02095e451c4bec565342f5ae6a5a /sys/fs/procfs | |
parent | faeb7168709de647ce9451abf06426670ebe52e0 (diff) | |
download | FreeBSD-src-b7ad7fee08d92c010db8d3a350b96a2607304a07.zip FreeBSD-src-b7ad7fee08d92c010db8d3a350b96a2607304a07.tar.gz |
For P_SUGID processes, we must also change ownership of the mem file
to root so that group kmem can still get to it. *SIGH*
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index 9155eb5..1124282 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94 * - * $Id: procfs_vnops.c,v 1.9 1995/04/15 02:30:17 davidg Exp $ + * $Id: procfs_vnops.c,v 1.10 1995/04/15 02:50:13 davidg Exp $ */ /* @@ -432,7 +432,15 @@ procfs_getattr(ap) ctob(procp->p_vmspace->vm_tsize + procp->p_vmspace->vm_dsize + procp->p_vmspace->vm_ssize); - vap->va_uid = procp->p_ucred->cr_uid; + /* + * If we denied owner access earlier, then we have to + * change the owner to root - otherwise 'ps' and friends + * will break even though they are setgid kmem. *SIGH* + */ + if (procp->p_flag & P_SUGID) + vap->va_uid = 0; + else + vap->va_uid = procp->p_ucred->cr_uid; vap->va_gid = KMEM_GROUP; break; |