summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2001-10-02 14:34:22 +0000
committerrwatson <rwatson@FreeBSD.org>2001-10-02 14:34:22 +0000
commitbf46cc0b03176c97feb13e6ce0715fdb353a2512 (patch)
treee97afbf48efa77dfbb66016b82fb5ad1556d5143 /sys/ufs
parentb348544a5d909bc8e3d79071162e855c0093eb0c (diff)
downloadFreeBSD-src-bf46cc0b03176c97feb13e6ce0715fdb353a2512.zip
FreeBSD-src-bf46cc0b03176c97feb13e6ce0715fdb353a2512.tar.gz
o Replace two direct uid!=0 comparisons with suser_td() calls.
Obtained from: TrustedBSD Project
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 48a8ba97..0f51888 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -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;
OpenPOWER on IntegriCloud