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

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