svn commit: r324273 - stable/11/sbin/mount
Edward Tomasz Napierala
trasz at FreeBSD.org
Wed Oct 4 12:04:37 UTC 2017
Author: trasz
Date: Wed Oct 4 12:04:35 2017
New Revision: 324273
URL: https://svnweb.freebsd.org/changeset/base/324273
Log:
MFC r320803:
Fix "mount -uw /" when the filesystem type doesn't match.
This basically makes "mount -uw /" work when the filesystem
mounted on / is NFS, but the one configured in fstab(5) is UFS,
which can happen when you forget to modify fstab.
Note that the whole special case ("else if (argv[0][0] == '/'")
is probably not needed anyway. I'll take a look at removing it
altogether; for now this is a minimally intrusive fix.
Modified:
stable/11/sbin/mount/mount.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sbin/mount/mount.c
==============================================================================
--- stable/11/sbin/mount/mount.c Wed Oct 4 12:02:42 2017 (r324272)
+++ stable/11/sbin/mount/mount.c Wed Oct 4 12:04:35 2017 (r324273)
@@ -397,7 +397,9 @@ main(int argc, char *argv[])
have_fstab = 1;
mntfromname = mntbuf->f_mntfromname;
} else if (argv[0][0] == '/' &&
- argv[0][1] == '\0') {
+ argv[0][1] == '\0' &&
+ strcmp(fs->fs_vfstype,
+ mntbuf->f_fstypename) == 0) {
fs = getfsfile("/");
have_fstab = 1;
mntfromname = fs->fs_spec;
More information about the svn-src-stable-11
mailing list