Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2017 20:08:10 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r317269 - in head/sys: fs/nfs sys
Message-ID:  <201704212008.v3LK8AVg075168@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Apr 21 20:08:10 2017
New Revision: 317269
URL: https://svnweb.freebsd.org/changeset/base/317269

Log:
  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.
  
  Discussed on:	freebsd-current@
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/sys/conf.h

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c	Fri Apr 21 20:03:08 2017	(r317268)
+++ head/sys/fs/nfs/nfs_commonsubs.c	Fri Apr 21 20:08:10 2017	(r317269)
@@ -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: head/sys/sys/conf.h
==============================================================================
--- head/sys/sys/conf.h	Fri Apr 21 20:03:08 2017	(r317268)
+++ head/sys/sys/conf.h	Fri Apr 21 20:08:10 2017	(r317269)
@@ -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,



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