o Replace two direct uid!=0 comparisons with suser_td() calls.
Obtained from: TrustedBSD Project
This commit is contained in:
parent
1e09a8ab6c
commit
b73d2870cd
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user