From owner-svn-src-head@freebsd.org Sat Jul 8 16:50:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25108D9DF62; Sat, 8 Jul 2017 16:50:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB6B1434; Sat, 8 Jul 2017 16:50:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v68GoHrI068309; Sat, 8 Jul 2017 09:50:17 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v68GoHgS068308; Sat, 8 Jul 2017 09:50:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201707081650.v68GoHgS068308@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r320803 - head/sbin/mount In-Reply-To: <201707081106.v68B6RFq054941@repo.freebsd.org> To: Edward Tomasz Napierala Date: Sat, 8 Jul 2017 09:50:17 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jul 2017 16:50:19 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: trasz > Date: Sat Jul 8 11:06:27 2017 > New Revision: 320803 > URL: https://svnweb.freebsd.org/changeset/base/320803 > > Log: > 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. Please do not silence user errors because they are inconvinient, this is a configuration error and the system should fail to mount the incorrectly configured root. If we start changing things to silently ignore user configuration errors we are going down a very slippery road. > 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. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D11323 > > Modified: > head/sbin/mount/mount.c > > Modified: head/sbin/mount/mount.c > ============================================================================== > --- head/sbin/mount/mount.c Sat Jul 8 09:28:31 2017 (r320802) > +++ head/sbin/mount/mount.c Sat Jul 8 11:06:27 2017 (r320803) > @@ -398,7 +398,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; > > -- Rod Grimes rgrimes@freebsd.org