Bug 172841

Summary: ZFS NFS exports => 1024 byte NIS-limits for netgroups
Product: Base System Reporter: Johannes Reinhard <johannes.reinhard>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Johannes Reinhard 2012-10-18 06:50:00 UTC
Using NFS exports from ZFS to a netgroup, netgroups are truncated to the traditional NIS entry limit of 1024 bytes, while they shouldn't. This happens regardless of the netgroup source (both settings files and ldap have been tried in nsswitch.conf). Also, if nscd is running or not does not seem to have any influence.

Here is example output how hostname for blarz.domain.de got truncated.

# cat /var/log/messages
..
Oct 18 07:17:22 fileserv mountd[7684]: can't get address info for host blarz.domai
Oct 18 07:17:22 fileserv mountd[7684]: bad host blarz.domai in netgroup mynetgroup, skipping
..

Another way to see the effects is to call

# showmount -e

Fix: 

Create multiple smaller netgroups and export to all of them.
How-To-Repeat: 1. Create a zfs volume
2. Create a large (>1024 byte) netgroup entry in /etc/netgroup - it must contain valid hosts
3. Configure /etc/nsswitch.conf to use /etc/netgroup as a netgroup source
   netgroup: files
4. Configure zfs NFS export using a netgroup
   # zfs set sharenfs="-alldirs mynetgroup" pool
5. read /var/log/messages and look for the message above
   # less /var/log/messages
6. use showmount -e to see where the netgroup got truncated
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:41 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped