summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2007-12-05 03:26:14 +0000
committerrodrigc <rodrigc@FreeBSD.org>2007-12-05 03:26:14 +0000
commitca18adc0b5e90ed3a6c27bd39493e50c4ce2f334 (patch)
treec23116195b628d038e469ffbbb4126e8f11f938d /sys/kern/vfs_mount.c
parent36f039142a2c8f0a5141e707c0316f3b47bd10bb (diff)
downloadFreeBSD-src-ca18adc0b5e90ed3a6c27bd39493e50c4ce2f334.zip
FreeBSD-src-ca18adc0b5e90ed3a6c27bd39493e50c4ce2f334.tar.gz
In nmount(), internally convert the mount option: "rdonly" to "ro".
This makes updates mounts such as: "mount -u -o rdonly" work more like, "mount -u -o ro". References to "-o rdonly" were changed to "-o ro" in revision 1.60 of the mount(8) man page, but some people still like to use "-o rdonly" since it was documented in earlier versions of FreeBSD. Requested by: rwatson MFC after: 1 week
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 3628b3b..dfb46e2 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -134,7 +134,6 @@ static const char *global_opts[] = {
"errmsg",
"fstype",
"fspath",
- "rdonly",
"ro",
"rw",
"nosuid",
@@ -684,9 +683,13 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions)
fsflags &= ~MNT_RDONLY;
has_rw = 1;
}
- else if (strcmp(opt->name, "ro") == 0 ||
- strcmp(opt->name, "rdonly") == 0)
+ else if (strcmp(opt->name, "ro") == 0)
fsflags |= MNT_RDONLY;
+ else if (strcmp(opt->name, "rdonly") == 0) {
+ free(opt->name, M_MOUNT);
+ opt->name = strdup("ro", M_MOUNT);
+ fsflags |= MNT_RDONLY;
+ }
else if (strcmp(opt->name, "snapshot") == 0)
fsflags |= MNT_SNAPSHOT;
else if (strcmp(opt->name, "suiddir") == 0)
OpenPOWER on IntegriCloud