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
This commit is contained in:
Robert Watson 2000-08-31 15:55:17 +00:00
parent b1f12b6157
commit c52396e365
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65293

View File

@ -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);
}