summaryrefslogtreecommitdiffstats
path: root/sys/fs/nullfs
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-03-02 12:42:23 +0000
committerjilles <jilles@FreeBSD.org>2013-03-02 12:42:23 +0000
commit869c43b8d97f429d8c3f5ca0accb16b2c17d9416 (patch)
tree41c62fea73acff337491caf5f63e356b88fc2f53 /sys/fs/nullfs
parent73650b4f3af1f7c8b2448569209fcdff427c08db (diff)
downloadFreeBSD-src-869c43b8d97f429d8c3f5ca0accb16b2c17d9416.zip
FreeBSD-src-869c43b8d97f429d8c3f5ca0accb16b2c17d9416.tar.gz
nullfs: Improve f_flags in statfs().
Include some flags of the nullfs mount itself: MNT_RDONLY, MNT_NOEXEC, MNT_NOSUID, MNT_UNION, MNT_NOSYMFOLLOW. This allows userland code calling statfs() or fstatfs() to see these flags. In particular, this allows opendir() to detect that a -t nullfs -o union mount needs deduplication (otherwise at least . and .. are returned twice) and allows rtld to detect a -t nullfs -o noexec mount as noexec. Turn off the MNT_ROOTFS flag from the underlying filesystem because the nullfs mount is definitely not the root filesystem. Reviewed by: kib MFC after: 1 week
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r--sys/fs/nullfs/null_vfsops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
index 3724e0a..02932bd 100644
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -313,7 +313,8 @@ nullfs_statfs(mp, sbp)
/* now copy across the "interesting" information and fake the rest */
sbp->f_type = mstat.f_type;
- sbp->f_flags = mstat.f_flags;
+ sbp->f_flags = (sbp->f_flags & (MNT_RDONLY | MNT_NOEXEC | MNT_NOSUID |
+ MNT_UNION | MNT_NOSYMFOLLOW)) | (mstat.f_flags & ~MNT_ROOTFS);
sbp->f_bsize = mstat.f_bsize;
sbp->f_iosize = mstat.f_iosize;
sbp->f_blocks = mstat.f_blocks;
OpenPOWER on IntegriCloud