On Tue, 17 May 2011 17:21:24 +0100 James Pearson <james-p@xxxxxxxxxxxxxxxxxx> wrote: > I'm using CentOS 5.x (nfs-utils based on v1.0.9) - and have been using > the following in /etc/exports: > > /export *(rw,async) @backup(rw,no_root_squash,async) > > which works fine - hosts in the backup NIS netgroup mount the file > system with no_root_squash and other clients with root_squash > > However, I now want to restrict the export to all clients in a single > subnet - so I now have /etc/exports as: > > /export 172.16.0.0/20(rw,async) @backup(rw,no_root_squash,async) > > Unfortunately, hosts in the backup NIS netgroup (which are also in the > 172.16.0.0/20 subnet) no longer mount with no_root_squash > > It appears that the subnet export takes precedence over the netgroup > export (it doesn't matter in what order the subnets/netgroups exports > are listed in /etc/exports) - so the netgroup client options are ignored > as a match has already been found in the subnet export. > > Is there any way to control the order in which clients are checked for > export options? > > i.e. I would like netgroups to take precedence over subnets Unfortunately you cannot do that. The place in the code where this is determined is towards the end of 'lookup_export' in utils/mountd/cache.c Were I to try to 'fix' this I would probably define a new field in 'struct exportent' which holds a 'priority'. Then allow a setting like "priority=4" in /etc/exports Then change the code in lookup_export to choose the one with the higher priority, rather than the 'first' one. NeilBrown -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html