o Replace two direct uid!=0 comparisons with suser_td() calls.

Obtained from:	TrustedBSD Project
This commit is contained in:
Robert Watson 2001-10-02 14:34:22 +00:00
parent 1e09a8ab6c
commit b73d2870cd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84373

View File

@ -219,7 +219,7 @@ ffs_mount(mp, path, data, ndp, td)
* If upgrade to read-write by non-root, then verify
* that user has necessary permissions on the device.
*/
if (td->td_proc->p_ucred->cr_uid != 0) {
if (suser_td(td)) {
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td);
if ((error = VOP_ACCESS(devvp, VREAD | VWRITE,
td->td_proc->p_ucred, td)) != 0) {
@ -300,7 +300,7 @@ ffs_mount(mp, path, data, ndp, td)
* If mount by non-root, then verify that user has necessary
* permissions on the device.
*/
if (td->td_proc->p_ucred->cr_uid != 0) {
if (suser_td(td)) {
accessmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
accessmode |= VWRITE;