1.\" Copyright (c) 1995 2.\" Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by Bill Paul. 15.\" 4. Neither the name of the University nor the names of its contributors 16.\" may be used to endorse or promote products derived from this software 17.\" without specific prior written permission. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND 20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE 23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" SUCH DAMAGE. 30.\" 31.Dd October 24, 1995 32.Dt REVNETGROUP 8 33.Os 34.Sh NAME 35.Nm revnetgroup 36.Nd "generate reverse netgroup data" 37.Sh SYNOPSIS 38.Nm 39.Fl u | h 40.Op Fl f Ar netgroup_file 41.Sh DESCRIPTION 42The 43.Nm 44utility processes the contents of a file in 45.Xr netgroup 5 46format into what is called 47.Pa reverse netgroup 48form. 49That is, where the original file shows 50netgroup memberships in terms of which members reside in a particular 51group, the reverse netgroup format specifies what groups are associated 52with a particular member. 53This information is used to generate the 54.Pa netgroup.byuser 55and 56.Pa netgroup.byhost 57.Tn NIS 58maps. 59These reverse netgroup maps are used to help speed up 60netgroup lookups, particularly for the 61.Fn innetgr 62library function. 63.Pp 64For example, the standard 65.Pa /etc/netgroup 66file may list a netgroup and a list of its members. 67Here, the 68netgroup is considered the 69.Em key 70and the member names are the 71.Em data . 72By contrast, the reverse 73.Pa netgroup.byuser 74database lists each unique 75member as the key and the netgroups to which the members belong become 76the data. 77Separate databases are created to hold information pertaining 78to users and hosts; this allows netgroup username lookups 79and netgroup hostname lookups to be performed using independent keyspaces. 80.Pp 81By constructing these reverse netgroup databases (and the corresponding 82.Tn NIS 83maps) in advance, the 84.Xr getnetgrent 3 85library functions are spared from having to work out the dependencies 86themselves on the fly. 87This is important on networks with large numbers 88of users and hosts, since it can take a considerable amount of time 89to process very large netgroup databases. 90.Pp 91The 92.Nm 93utility prints its results on the standard output. 94It is usually called 95only by 96.Pa /var/yp/Makefile 97when rebuilding the 98.Tn NIS 99netgroup maps. 100.Sh OPTIONS 101The 102.Nm 103utility supports the following options: 104.Bl -tag -width indent 105.It Fl u 106Generate 107.Pa netgroup.byuser 108output; only username information in the 109original netgroup file is processed. 110.It Fl h 111Generate 112.Pa netgroup.byhost 113output; only hostname information in the 114original netgroup file is processed. 115(Note at least one of the 116.Fl u 117or 118.Fl h 119flags must be specified.) 120.It Op Fl f Ar netgroup_file 121The 122.Nm 123utility uses 124.Pa /etc/netgroup 125as its default input file. 126The 127.Fl f 128flag allows the user to specify an alternate input file. 129Specifying ``-'' 130as the input file causes 131.Nm 132to read from the standard input. 133.El 134.Sh FILES 135.Bl -tag -width /var/yp/Makefile -compact 136.It Pa /var/yp/Makefile 137the Makefile that calls 138.Nm yp_mkdb 139and 140.Nm 141to build the 142.Tn NIS 143databases 144.It Pa /etc/netgroup 145the default netgroup database file. 146This file is most often found 147only on the 148.Tn NIS 149master server 150.El 151.Sh SEE ALSO 152.Xr getnetgrent 3 , 153.Xr netgroup 5 , 154.Xr yp 8 , 155.Xr yp_mkdb 8 156.Sh AUTHORS 157.An Bill Paul Aq Mt wpaul@ctr.columbia.edu 158