Call prison_check from vfs_suser rather than re-implementing it.

Approved by:	re (kib), bz (mentor)
This commit is contained in:
Jamie Gritton 2009-07-02 14:19:33 +00:00
parent 0162436974
commit f0899a3460

View file

@ -461,8 +461,7 @@ vfs_suser(struct mount *mp, struct thread *td)
* If the file system was mounted outside the jail of the calling
* thread, deny immediately.
*/
if (mp->mnt_cred->cr_prison != td->td_ucred->cr_prison &&
!prison_ischild(td->td_ucred->cr_prison, mp->mnt_cred->cr_prison))
if (prison_check(td->td_ucred, mp->mnt_cred) != 0)
return (EPERM);
/*