I have a NFS4 export (from FreeBSD ZFS filesystem) with root_squash turned off (-maproot=root).
Until recently I've been mounting this drive without problems on several machines (mostly Ubuntu 12.04 server), but all of a sudden I've run into this strange problem:
On three OSes I've tried to setup (Mint 15, Ubuntu 13.04, Ubuntu 12.04 client) I do the ldap and nfs configuration and mount the drives and everything appears fine. I can see appropriate user and group names mapped from ids. But if I try to chown any of these files to any other user it always sets them to nobody:nobody.
Note, this does not happen on the older machines. I've even copied the exact configurations (/etc/idmapd.conf, /etc/ldap*, /etc/pam.d/*) from the older Ubuntu 12.04 machines to the new one and it still won't work! It also seems mostly restricted to chown. I can touch new files as any user and they have correct ownership. I have no idea what's going on.
The only clue I might have gotten is that the broken machines give this error in syslog (after increasing verbosity in idmapd):
Sep 10 16:58:48 cabernet rpc.idmapd[1009]: nfs4_name_to_uid: calling nsswitch->name_to_uid
Sep 10 16:58:48 cabernet rpc.idmapd[1009]: nss_getpwnam: name '5000@test.com' domain 'test.com': resulting localname '5000'
Sep 10 16:58:48 cabernet rpc.idmapd[1009]: nss_getpwnam: name '5000' not found in domain 'test.com'
While the working machines give:
Sep 10 17:03:44 node-2 rpc.idmapd[2906]: nfs4_uid_to_name: calling nsswitch->uid_to_name
Sep 10 17:03:44 node-2 rpc.idmapd[2906]: nfs4_uid_to_name: nsswitch->uid_to_name returned 0
Sep 10 17:03:44 node-2 rpc.idmapd[2906]: nfs4_uid_to_name: final return value is 0
Sep 10 17:03:44 node-2 rpc.idmapd[2906]: Client 18: (user) id "5000" -> name "myname@test.com"
So it looks like for some reason the broken machines are trying to use the id as the username.
Any advice?