Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Sep 2015 15:07:26 -0400
From:      "Michael W. Lucas" <mwlucas@michaelwlucas.com>
To:        questions@freebsd.org
Subject:   nfsv4 file ownership
Message-ID:  <20150915190726.GA8073@mail.michaelwlucas.com>

next in thread | raw e-mail | index | archive | help

Hi,

I think I fundamentally misunderstand something on how nfsv4 maps
usernames. Everything works fine... until I start nfsuserd.

I have a NFSv4 server on my test network. It's enabled with these
rc.conf flags.

nfs_server_enable=YES
nfs_server_flags="-uth 203.0.113.50 -n6"
rpcbind_enable=YES
mountd_enable=YES
mountd_flags="-r -l"
rpc_lockd_enable=YES
rpc_statd_enable=YES
nfsv4_server_enable=YES
nfsuserd_enable=YES
nfsuserd_flags="-verbose"

server# uname -a
FreeBSD storm 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r287374: Tue Sep  1 15:31:17 EDT 2015     root@storm:/usr/obj/usr/src/sys/GENERIC  amd64

client# uname -a
FreeBSD freebsd 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

The exports file contains:

V4: /home

Usernames and UIDs are matched for the test user.

server# getent passwd mwlucas
mwlucas:*:10001:10001:mwlucas:/home/mwlucas:/bin/tcsh

client# getent passwd mwlucas
mwlucas:*:10001:10001:mwlucas:/home/mwlucas:/bin/tcsh

I mount a directory with:

# mount -o nfsv4 storm:/mwlucas /mnt


When nfsuserd is running, all files in /mnt/ are owned by
root:wheel. Running in verbose mode, I get log messages like:

Sep 15 14:41:13 storm nfsuserd:[1730]: Added uid=0 name=root
Sep 15 14:41:13 storm nfsuserd:[1729]: Added gid=0 name=wheel
Sep 15 14:41:13 storm nfsuserd:[1730]: Added uid=10001 name=mwlucas
Sep 15 14:41:13 storm nfsuserd:[1730]: Added gid=10001 name=mwlucas

If I stop nfsuserd, unmount the directory, and remount, all files have
their correct ownership.

Isn't nfsuserd supposed to give the correct usernames? What am I
missing here?

Any help appreciated!

==ml

-- 
Michael W. Lucas  -  mwlucas@michaelwlucas.com, Twitter @mwlauthor 
http://www.MichaelWLucas.com/, http://blather.MichaelWLucas.com/



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