Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Oct 2017 12:04:36 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r324273 - stable/11/sbin/mount
Message-ID:  <201710041204.v94C4axZ016904@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710041204.v94C4axZ016904>