From owner-svn-src-all@freebsd.org Fri Apr 7 18:31:33 2017 Return-Path: Delivered-To: svn-src-all@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 5B822D32E72; Fri, 7 Apr 2017 18:31:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B52FA8E; Fri, 7 Apr 2017 18:31:33 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v37IVW7q090503; Fri, 7 Apr 2017 18:31:32 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v37IVWGP090486; Fri, 7 Apr 2017 18:31:32 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201704071831.v37IVWGP090486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 7 Apr 2017 18:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316619 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Apr 2017 18:31:33 -0000 Author: brooks Date: Fri Apr 7 18:31:31 2017 New Revision: 316619 URL: https://svnweb.freebsd.org/changeset/base/316619 Log: Remove support for long gone oldnfs. The code was calling nmount with an fstype of everything in the program name after the last '_'. This was there to support mount_nfs being linked to mount_oldnfs. Support for the link was removed in 2015 with r281691. Reviewed by: rmacklem Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10301 Modified: head/sbin/mount_nfs/mount_nfs.c Modified: head/sbin/mount_nfs/mount_nfs.c ============================================================================== --- head/sbin/mount_nfs/mount_nfs.c Fri Apr 7 17:00:36 2017 (r316618) +++ head/sbin/mount_nfs/mount_nfs.c Fri Apr 7 18:31:31 2017 (r316619) @@ -153,19 +153,13 @@ main(int argc, char *argv[]) char *mntname, *p, *spec, *tmp; char mntpath[MAXPATHLEN], errmsg[255]; char hostname[MAXHOSTNAMELEN + 1], gssn[MAXHOSTNAMELEN + 50]; - const char *fstype, *gssname; + const char *gssname; iov = NULL; iovlen = 0; memset(errmsg, 0, sizeof(errmsg)); gssname = NULL; - fstype = strrchr(argv[0], '_'); - if (fstype == NULL) - errx(EX_USAGE, "argv[0] must end in _fstype"); - - ++fstype; - while ((c = getopt(argc, argv, "23a:bcdD:g:I:iLlNo:PR:r:sTt:w:x:U")) != -1) switch (c) { @@ -272,7 +266,6 @@ main(int argc, char *argv[]) } else if (strcmp(opt, "nfsv4") == 0) { pass_flag_to_nmount=0; mountmode = V4; - fstype = "nfs"; nfsproto = IPPROTO_TCP; if (portspec == NULL) portspec = "2049"; @@ -355,7 +348,6 @@ main(int argc, char *argv[]) break; case 4: mountmode = V4; - fstype = "nfs"; nfsproto = IPPROTO_TCP; if (portspec == NULL) portspec = "2049"; @@ -436,17 +428,11 @@ main(int argc, char *argv[]) /* The default is to keep retrying forever. */ retrycnt = 0; - /* - * If the fstye is "oldnfs", run the old NFS client unless the - * "nfsv4" option was specified. - */ - if (strcmp(fstype, "nfs") == 0) { - if (modfind("nfscl") < 0) { - /* Not present in kernel, try loading it */ - if (kldload("nfscl") < 0 || - modfind("nfscl") < 0) - errx(1, "nfscl is not available"); - } + if (modfind("nfscl") < 0) { + /* Not present in kernel, try loading it */ + if (kldload("nfscl") < 0 || + modfind("nfscl") < 0) + errx(1, "nfscl is not available"); } /* @@ -470,8 +456,7 @@ main(int argc, char *argv[]) if (checkpath(mntname, mntpath) != 0) err(1, "%s", mntpath); - build_iovec(&iov, &iovlen, "fstype", - __DECONST(void *, fstype), (size_t)-1); + build_iovec_argf(&iov, &iovlen, "fstype", "nfs"); build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));