svn commit: r317917 - in stable/10/sys: fs/nfs sys
Rick Macklem
rmacklem at FreeBSD.org
Sun May 7 20:22:01 UTC 2017
Author: rmacklem
Date: Sun May 7 20:21:59 2017
New Revision: 317917
URL: https://svnweb.freebsd.org/changeset/base/317917
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/10/sys/fs/nfs/nfs_commonsubs.c
stable/10/sys/sys/conf.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- stable/10/sys/fs/nfs/nfs_commonsubs.c Sun May 7 20:11:58 2017 (r317916)
+++ stable/10/sys/fs/nfs/nfs_commonsubs.c Sun May 7 20:21:59 2017 (r317917)
@@ -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/10/sys/sys/conf.h
==============================================================================
--- stable/10/sys/sys/conf.h Sun May 7 20:11:58 2017 (r317916)
+++ stable/10/sys/sys/conf.h Sun May 7 20:21:59 2017 (r317917)
@@ -335,6 +335,7 @@ void devfs_free_cdp_inode(ino_t ino);
#define GID_BIN 7
#define GID_GAMES 13
#define GID_DIALER 68
+#define GID_NOGROUP 65533
#define GID_NOBODY 65534
typedef void (*dev_clone_fn)(void *arg, struct ucred *cred, char *name,
More information about the svn-src-stable-10
mailing list