diff options
| author | Bruce Evans <bde@FreeBSD.org> | 2000-03-09 05:21:10 +0000 |
|---|---|---|
| committer | Bruce Evans <bde@FreeBSD.org> | 2000-03-09 05:21:10 +0000 |
| commit | d1a417f17ed3893fe20613320b44ecd60c0435b2 (patch) | |
| tree | 801c9dfcb68aa31c2f0a3f3db343a9bd3f89fd8e /sys/gnu/ext2fs | |
| parent | ca6da1de5e982ef2999e6a326c8039ee32cfaac3 (diff) | |
Notes
Diffstat (limited to 'sys/gnu/ext2fs')
| -rw-r--r-- | sys/gnu/ext2fs/ext2_vfsops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index ac30793a1c64..a56a443de578 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -218,13 +218,16 @@ ext2_mount(mp, path, data, ndp, p) error = ext2_reload(mp, ndp->ni_cnd.cn_cred, p); if (error) return (error); + devvp = ump->um_devvp; + if (ext2_check_sb_compat(fs->s_es, devvp->v_rdev, + (mp->mnt_kern_flag & MNTK_WANTRDWR) == 0) != 0) + return (EPERM); if (fs->s_rd_only && (mp->mnt_kern_flag & MNTK_WANTRDWR)) { /* * If upgrade to read-write by non-root, then verify * that user has necessary permissions on the device. */ if (p->p_ucred->cr_uid != 0) { - devvp = ump->um_devvp; vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); if ((error = VOP_ACCESS(devvp, VREAD | VWRITE, p->p_ucred, p)) != 0) { |
