From owner-svn-src-stable@freebsd.org Sun May 7 20:11:59 2017 Return-Path: Delivered-To: svn-src-stable@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 E8018D62A2C; Sun, 7 May 2017 20:11:59 +0000 (UTC) (envelope-from rmacklem@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 9255AC91; Sun, 7 May 2017 20:11:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v47KBwQK021349; Sun, 7 May 2017 20:11:58 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v47KBw4D021347; Sun, 7 May 2017 20:11:58 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201705072011.v47KBw4D021347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 7 May 2017 20:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317916 - in stable/11/sys: fs/nfs sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 May 2017 20:12:00 -0000 Author: rmacklem Date: Sun May 7 20:11:58 2017 New Revision: 317916 URL: https://svnweb.freebsd.org/changeset/base/317916 Log: MFC: r317269 Set default uid/gid to nobody/nogroup for NFSv4 mapping. The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon. However, they were 0 until the nfsuserd(8) was run. Since it is possible to use NFSv4 without running the nfsuserd(8) daemon, set them to nobody/nogroup initially. Without this patch, the values would be set by the nfsuserd(8) daemon and left changed even if the nfsuserd(8) daemon was killed. The default values of 0 meant that setting a group to "wheel" would fail even when done by root. It also adds a definition of GID_NOGROUP to sys/conf.h. Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/sys/conf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Sun May 7 19:59:37 2017 (r317915) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Sun May 7 20:11:58 2017 (r317916) @@ -63,8 +63,8 @@ int nfsrv_useacl = 1; struct nfssockreq nfsrv_nfsuserdsock; int nfsrv_nfsuserd = 0; struct nfsreqhead nfsd_reqq; -uid_t nfsrv_defaultuid; -gid_t nfsrv_defaultgid; +uid_t nfsrv_defaultuid = UID_NOBODY; +gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; Modified: stable/11/sys/sys/conf.h ============================================================================== --- stable/11/sys/sys/conf.h Sun May 7 19:59:37 2017 (r317915) +++ stable/11/sys/sys/conf.h Sun May 7 20:11:58 2017 (r317916) @@ -315,6 +315,7 @@ void devfs_free_cdp_inode(ino_t ino); #define GID_GAMES 13 #define GID_VIDEO 44 #define GID_DIALER 68 +#define GID_NOGROUP 65533 #define GID_NOBODY 65534 typedef void (*dev_clone_fn)(void *arg, struct ucred *cred, char *name,