diff options
author | phk <phk@FreeBSD.org> | 2004-12-11 20:37:48 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-12-11 20:37:48 +0000 |
commit | 40fb82789b4052872a7270936aa875335f201dac (patch) | |
tree | bb789d3e13117c468a8b44d41213051fe6c8acde | |
parent | e0d65a7ca43617440c1aed8ff4f1145989da5c92 (diff) | |
download | FreeBSD-src-40fb82789b4052872a7270936aa875335f201dac.zip FreeBSD-src-40fb82789b4052872a7270936aa875335f201dac.tar.gz |
Handle MNT_UPDATE export requests first and return so we do not
interpret the rest of the msdosfs_args structure.
Detected by: marcel
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 95be396..a5a9680 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -239,11 +239,11 @@ static int msdosfs_mount(struct mount *mp, struct thread *td) { struct vnode *devvp; /* vnode for blk device to mount */ - struct export_args *export; + struct export_args export; /* msdosfs specific mount control block */ struct msdosfsmount *pmp = NULL; struct nameidata ndp; - int error, flags, len; + int error, flags; mode_t accessmode; char *from; @@ -256,7 +256,18 @@ msdosfs_mount(struct mount *mp, struct thread *td) */ if (mp->mnt_flag & MNT_UPDATE) { pmp = VFSTOMSDOSFS(mp); - error = 0; + + error = vfs_copyopt(mp->mnt_optnew, "export", + &export, sizeof export); + if (error == 0 && export.ex_flags != 0) { + /* + * Process export requests. + */ + if ((export.ex_flags & MNT_EXPORTED) != 0 && + (pmp->pm_flags & MSDOSFS_LARGEFS) != 0) + return (EOPNOTSUPP); + return (vfs_export(mp, &export)); + } if (!(pmp->pm_flags & MSDOSFSMNT_RONLY) && vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) { error = VFS_SYNC(mp, MNT_WAIT, td->td_ucred, td); @@ -316,17 +327,6 @@ msdosfs_mount(struct mount *mp, struct thread *td) pmp->pm_flags |= MSDOSFSMNT_SHORTNAME; } #endif - error = vfs_getopt(mp->mnt_optnew, "export", - (void **)&export, &len); - if (error || len != sizeof *export) - return (EINVAL); - /* - * Process export requests. - */ - if ((export->ex_flags & MNT_EXPORTED) != 0 && - (pmp->pm_flags & MSDOSFS_LARGEFS) != 0) - return (EOPNOTSUPP); - return (vfs_export(mp, export)); } } /* |