1*01869ca4Swiz.\" $NetBSD: revnetgroup.8,v 1.14 2017/07/03 21:35:32 wiz Exp $ 27307c9a9Slukem.\" 342f1aa04Slukem.\" Copyright (c) 1995 442f1aa04Slukem.\" Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 542f1aa04Slukem.\" 642f1aa04Slukem.\" Redistribution and use in source and binary forms, with or without 742f1aa04Slukem.\" modification, are permitted provided that the following conditions 842f1aa04Slukem.\" are met: 942f1aa04Slukem.\" 1. Redistributions of source code must retain the above copyright 1042f1aa04Slukem.\" notice, this list of conditions and the following disclaimer. 1142f1aa04Slukem.\" 2. Redistributions in binary form must reproduce the above copyright 1242f1aa04Slukem.\" notice, this list of conditions and the following disclaimer in the 1342f1aa04Slukem.\" documentation and/or other materials provided with the distribution. 1442f1aa04Slukem.\" 3. All advertising materials mentioning features or use of this software 1542f1aa04Slukem.\" must display the following acknowledgement: 1642f1aa04Slukem.\" This product includes software developed by Bill Paul. 1742f1aa04Slukem.\" 4. Neither the name of the University nor the names of its contributors 1842f1aa04Slukem.\" may be used to endorse or promote products derived from this software 1942f1aa04Slukem.\" without specific prior written permission. 2042f1aa04Slukem.\" 2142f1aa04Slukem.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND 2242f1aa04Slukem.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2342f1aa04Slukem.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2442f1aa04Slukem.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE 2542f1aa04Slukem.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2642f1aa04Slukem.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2742f1aa04Slukem.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2842f1aa04Slukem.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2942f1aa04Slukem.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3042f1aa04Slukem.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3142f1aa04Slukem.\" SUCH DAMAGE. 3242f1aa04Slukem.\" 33206fd501Swiz.Dd February 26, 2005 3442f1aa04Slukem.Dt REVNETGROUP 8 3542f1aa04Slukem.Os 3642f1aa04Slukem.Sh NAME 3742f1aa04Slukem.Nm revnetgroup 38721843cfSlukem.Nd generate reverse netgroup data 3942f1aa04Slukem.Sh SYNOPSIS 40990562bfSwiz.Nm 411ac719d1Swiz.Op Fl hu 4242f1aa04Slukem.Op Fl f Ar netgroup_file 4342f1aa04Slukem.Sh DESCRIPTION 447307c9a9Slukem.Nm 4542f1aa04Slukemprocesses the contents of a file in 4642f1aa04Slukem.Xr netgroup 5 4742f1aa04Slukemformat into what is called 4842f1aa04Slukem.Pa reverse netgroup 4942f1aa04Slukemform. That is, where the original file shows 5042f1aa04Slukemnetgroup memberships in terms of which members reside in a particular 5142f1aa04Slukemgroup, the reverse netgroup format specifies what groups are associated 5242f1aa04Slukemwith a particular member. This information is used to generate the 537307c9a9Slukem.Pa netgroup.byuser 5442f1aa04Slukemand 557307c9a9Slukem.Pa netgroup.byhosts 56afca2fb3Sthorpej.Tn NIS 57721843cfSlukemmaps. These reverse netgroup maps are used to help speed up 5842f1aa04Slukemnetgroup lookups, particularly for the 5942f1aa04Slukem.Fn innetgr 6042f1aa04Slukemlibrary function. 6142f1aa04Slukem.Pp 6242f1aa04SlukemFor example, the standard 637307c9a9Slukem.Pa /etc/netgroup 6442f1aa04Slukemfile may list a netgroup and a list of its members. Here, the 6542f1aa04Slukemnetgroup is considered the 6642f1aa04Slukem.Pa key 6742f1aa04Slukemand the member names are the 6842f1aa04Slukem.Pa data . 6942f1aa04SlukemBy contrast, the reverse 707307c9a9Slukem.Pa netgroup.byusers 7142f1aa04Slukemdatabase lists each unique 7242f1aa04Slukemmember as the key and the netgroups to which the members belong become 7366df0333Swizthe data. Separate databases are created to hold information pertaining 7442f1aa04Slukemto users and hosts; this allows netgroup username lookups 7542f1aa04Slukemand netgroup hostname lookups to be performed using independent keyspaces. 7642f1aa04Slukem.Pp 7742f1aa04SlukemBy constructing these reverse netgroup databases (and the corresponding 78afca2fb3Sthorpej.Tn NIS 79721843cfSlukemmaps) in advance, the 8042f1aa04Slukem.Xr getnetgrent 3 8142f1aa04Slukemlibrary functions are spared from having to work out the dependencies 8242f1aa04Slukemthemselves on the fly. This is important on networks with large numbers 8342f1aa04Slukemof users and hosts, since it can take a considerable amount of time 8442f1aa04Slukemto process very large netgroup databases. 8542f1aa04Slukem.Pp 8642f1aa04SlukemThe 877307c9a9Slukem.Nm 8842f1aa04Slukemcommand prints its results on the standard output. It is usually called 8942f1aa04Slukemonly by 90*01869ca4Swiz.Pa /var/yp/<domain>/Makefile 91721843cfSlukemwhen rebuilding the 92afca2fb3Sthorpej.Tn NIS 93721843cfSlukemnetgroup maps. 9442f1aa04Slukem.Sh OPTIONS 9542f1aa04SlukemThe 967307c9a9Slukem.Nm 9742f1aa04Slukemcommand supports the following options: 9842f1aa04Slukem.Bl -tag -width flag 9942f1aa04Slukem.It Fl u 10042f1aa04SlukemGenerate netgroup.byuser output; only username information in the 10142f1aa04Slukemoriginal netgroup file is processed. 10242f1aa04Slukem.It Fl h 10342f1aa04SlukemGenerate netgroup.byhost output; only hostname information in the 10442f1aa04Slukemoriginal netgroup file is processed. (Note at least one of the 10542f1aa04Slukem.Fl u 10642f1aa04Slukemor 10742f1aa04Slukem.Fl h 10842f1aa04Slukemflags must be specified.) 10942f1aa04Slukem.It Op Fl f Ar netgroup_file 11042f1aa04SlukemThe 1117307c9a9Slukem.Nm 11242f1aa04Slukemcommand uses 1137307c9a9Slukem.Pa /etc/netgroup 11442f1aa04Slukemas its default input file. The 11542f1aa04Slukem.Fl f 11642f1aa04Slukemflag allows the user to specify an alternate input file. Specifying ``-'' 11742f1aa04Slukemas the input file causes 1187307c9a9Slukem.Nm 11942f1aa04Slukemto read from the standard input. 12042f1aa04Slukem.El 12142f1aa04Slukem.Sh FILES 12242f1aa04Slukem.Bl -tag -width Pa -compact 123*01869ca4Swiz.It Pa /var/yp/<domain>/Makefile 12442f1aa04SlukemThe Makefile that calls 12542f1aa04Slukem.Nm makedbm 12642f1aa04Slukemand 12742f1aa04Slukem.Nm revnetgroup 128721843cfSlukemto build the 129afca2fb3Sthorpej.Tn NIS 130721843cfSlukemdatabases. 13142f1aa04Slukem.It Pa /etc/netgroup 13242f1aa04SlukemThe default netgroup database file. This file is most often found 133721843cfSlukemonly on the 134afca2fb3Sthorpej.Tn NIS 135721843cfSlukemmaster server. 13642f1aa04Slukem.El 13742f1aa04Slukem.Sh SEE ALSO 13842f1aa04Slukem.Xr getnetgrent 3 , 13942f1aa04Slukem.Xr netgroup 5 , 140d8e5f0a4Swiz.Xr makedbm 8 , 141afca2fb3Sthorpej.Xr nis 8 142d8e5f0a4Swiz.Sh AUTHORS 143a5684d07Swiz.An Bill Paul Aq Mt wpaul@ctr.columbia.edu 144