From owner-freebsd-commit Sun Mar 26 15:36:47 1995 Return-Path: commit-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id PAA17195 for commit-outgoing; Sun, 26 Mar 1995 15:36:47 -0800 Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id PAA17180 for cvs-sbin-outgoing; Sun, 26 Mar 1995 15:36:45 -0800 Received: (from wpaul@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id PAA17157; Sun, 26 Mar 1995 15:36:40 -0800 Date: Sun, 26 Mar 1995 15:36:40 -0800 From: Bill Paul Message-Id: <199503262336.PAA17157@freefall.cdrom.com> To: CVS-commiters, cvs-sbin Subject: cvs commit: src/sbin/mountd mountd.c Sender: commit-owner@FreeBSD.org Precedence: bulk wpaul 95/03/26 15:36:39 Modified: sbin/mountd mountd.c Log: Fixed stupid bug in mountd: it would seem that the kernel doesn't allow you to push the same host into its NFS export lists twice, but mountd tries to do it anyway. This means that putting: /some_file_system -ro host1 host1 in your /etc/exports file causes an error. This is bogus: mountd should be smart enough to ignore the second instance of host1. This can be a problem in some configurations that use netgroups. For example, each host in my netgroups database is has two entries: startide (startide,-,) (startide.ctr.columbia.edu,-,) When mountd sees this, it tries to put startide.ctr.columbia.edu into the export list *twice*. Just listing 'startide' /etc/exports list will also screw up because mountd will try to resolve the netgroup 'startide' instead of the hostname 'startide.' My solution is watch for duplicate entries in get_host() and mark them as grouptype GT_IGNORE, which do_mount() will now cheefully throw away. This is a bit of a kludge, but it was the least obtrusive fix I could come up with. Also silenced a compiler warning: arguments passwd to xdr_long() should be u_long, not int. :)