diff options
author | jhb <jhb@FreeBSD.org> | 2001-11-28 18:25:39 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-11-28 18:25:39 +0000 |
commit | d5902a539c0bb362f4aeaea0e5a4687a05fb9c8a (patch) | |
tree | 44c4fbf09ad5bd1722a888ebb9dfec780ce1e109 | |
parent | 1ec55073a7ee33b3d8b29b6e149fdd0221b05158 (diff) | |
download | FreeBSD-src-d5902a539c0bb362f4aeaea0e5a4687a05fb9c8a.zip FreeBSD-src-d5902a539c0bb362f4aeaea0e5a4687a05fb9c8a.tar.gz |
Use suser_td() instead of explicitly checking cr_uid against 0.
PR: kern/21809
Submitted by: <mbendiks@eunet.no>
Reviewed by: rwatson
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index d3b1c58..687956f 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -195,7 +195,7 @@ msdosfs_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)) { devvp = pmp->pm_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, td); error = VOP_ACCESS(devvp, VREAD | VWRITE, @@ -242,7 +242,7 @@ msdosfs_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; diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index bbdcecb..d506937 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -390,7 +390,7 @@ msdosfs_setattr(ap) * set ATTR_ARCHIVE for directories `cp -pr' from a more * sensible file system attempts it a lot. */ - if (cred->cr_uid != 0) { + if (suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)) { if (vap->va_flags & SF_SETTABLE) return EPERM; } |