summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2000-08-31 15:55:17 +0000
committerrwatson <rwatson@FreeBSD.org>2000-08-31 15:55:17 +0000
commit97d4af5bf107202b943686c90718b7c16e5ffe86 (patch)
tree7ea661e521a5eef79520495833dab5a2e8673716
parent8f6295e0c7ad66ba5a3462b84794e1cac156450b (diff)
downloadFreeBSD-src-97d4af5bf107202b943686c90718b7c16e5ffe86.zip
FreeBSD-src-97d4af5bf107202b943686c90718b7c16e5ffe86.tar.gz
o p_cansee() wasn't setting privused when suser() was required to override
kern.ps_showallprocs. Apparently got lost in the merge process from the capability patches. Now fixed. Submitted by: jdp Obtained from: TrustedBSD Project
-rw-r--r--sys/kern/kern_prot.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 0750466..4ce571d 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -981,9 +981,14 @@ p_cansee(const struct proc *p1, const struct proc *p2, int *privused)
if (!PRISON_CHECK(p1, p2))
return (ESRCH);
- if (!ps_showallprocs && (p1->p_ucred->cr_uid != p2->p_ucred->cr_uid) &&
- suser_xxx(NULL, p1, PRISON_ROOT))
+ if (!ps_showallprocs && p1->p_ucred->cr_uid != p2->p_ucred->cr_uid) {
+ if (suser_xxx(NULL, p1, PRISON_ROOT) == 0) {
+ if (privused != NULL)
+ *privused = 1;
+ return (0);
+ }
return (ESRCH);
+ }
return (0);
}
OpenPOWER on IntegriCloud