aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount/mntopts.h
diff options
context:
space:
mode:
authorSean Eric Fagan <sef@FreeBSD.org>2019-09-23 04:28:07 +0000
committerSean Eric Fagan <sef@FreeBSD.org>2019-09-23 04:28:07 +0000
commitba7a55d93465725fd860066d95d4e910c3c027c2 (patch)
treee46ac60f38cbac374d17571c2895139d8899b29b /sbin/mount/mntopts.h
parent7505cffa56d7347436b32f8d3f192ad1c4383ad8 (diff)
downloadsrc-ba7a55d93465725fd860066d95d4e910c3c027c2.tar.gz
src-ba7a55d93465725fd860066d95d4e910c3c027c2.zip
Add two options to allow mount to avoid covering up existing mount points.
The two options are * nocover/cover: Prevent/allow mounting over an existing root mountpoint. E.g., "mount -t ufs -o nocover /dev/sd1a /usr/local" will fail if /usr/local is already a mountpoint. * emptydir/noemptydir: Prevent/allow mounting on a non-empty directory. E.g., "mount -t ufs -o emptydir /dev/sd1a /usr" will fail. Neither of these options is intended to be a default, for historical and compatibility reasons. Reviewed by: allanjude, kib Differential Revision: https://reviews.freebsd.org/D21458
Notes
Notes: svn path=/head/; revision=352614
Diffstat (limited to 'sbin/mount/mntopts.h')
-rw-r--r--sbin/mount/mntopts.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/mount/mntopts.h b/sbin/mount/mntopts.h
index 924ead253890..183d6d9e501d 100644
--- a/sbin/mount/mntopts.h
+++ b/sbin/mount/mntopts.h
@@ -65,7 +65,8 @@ struct mntopt {
#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 }
#define MOPT_RO { "ro", 0, MNT_RDONLY, 0 }
#define MOPT_RW { "rw", 1, MNT_RDONLY, 0 }
-
+#define MOPT_NOCOVER { "cover", 1, MNT_NOCOVER, 0 }
+#define MOPT_EMPTYDIR { "emptydir", 0, MNT_EMPTYDIR, 0 }
/* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */
#define MOPT_AUTO { "auto", 0, 0, 0 }
@@ -95,7 +96,9 @@ struct mntopt {
MOPT_ACLS, \
MOPT_NFS4ACLS, \
MOPT_AUTOMOUNTED, \
- MOPT_UNTRUSTED
+ MOPT_UNTRUSTED, \
+ MOPT_NOCOVER, \
+ MOPT_EMPTYDIR
void getmntopts(const char *, const struct mntopt *, int *, int *);
void rmslashes(char *, char *);