From nobody@FreeBSD.org  Thu Oct 18 05:41:01 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 085EECD5
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Oct 2012 05:41:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id E28F78FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Oct 2012 05:41:00 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9I5f0A5042854
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 18 Oct 2012 05:41:00 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q9I5f0JP042853;
	Thu, 18 Oct 2012 05:41:00 GMT
	(envelope-from nobody)
Message-Id: <201210180541.q9I5f0JP042853@red.freebsd.org>
Date: Thu, 18 Oct 2012 05:41:00 GMT
From: Johannes Reinhard <johannes.reinhard@physik.uni-erlangen.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ZFS NFS exports => 1024 byte NIS-limits for netgroups
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172841
>Category:       kern
>Synopsis:       ZFS NFS exports => 1024 byte NIS-limits for netgroups
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 18 05:50:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Johannes Reinhard
>Release:        FreeBSD 9.1-RC2
>Organization:
FAU Erlangen-Nrnberg
>Environment:
FreeBSD fileserv 9.1-RC2 FreeBSD 9.1-RC2 #0 r241106: Mon Oct  1 18:26:44 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
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

>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

>Fix:
Create multiple smaller netgroups and export to all of them.


>Release-Note:
>Audit-Trail:
>Unformatted:
