summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2017-05-07 20:21:59 +0000
committerrmacklem <rmacklem@FreeBSD.org>2017-05-07 20:21:59 +0000
commitcb0edd9768e2bdbf8025274f425b2ef202af3dbc (patch)
tree37071fb2b9978d9e2ea303d16ca0714192c2701c /sys/fs
parentbb3853186be3ca85a15402c2faab6d117d526f79 (diff)
downloadFreeBSD-src-cb0edd9768e2bdbf8025274f425b2ef202af3dbc.zip
FreeBSD-src-cb0edd9768e2bdbf8025274f425b2ef202af3dbc.tar.gz
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.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 0c2317d..7cf3ca3 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -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;
OpenPOWER on IntegriCloud