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.\" $Id$ 32.\" 33.Dd October 24, 1995 34.Dt REVNETGROUP 8 35.Os 36.Sh NAME 37.Nm revnetgroup 38.Nd "generate reverse netgroup data" 39.Sh SYNOPSIS 40.Nm revnetgroup 41.Fl u 42.Fl h 43.Op Fl f Ar netgroup_file 44.Sh DESCRIPTION 45.Nm revnetgroup 46processes the contents of a file in 47.Xr netgroup 5 48format into what is called 49.Pa reverse netgroup 50form. That is, where the original file shows 51netgroup memberships in terms of which members reside in a particular 52group, the reverse netgroup format specifies what groups are associated 53with a particular member. This information is used to generate the 54.Nm netgroup.byuser 55and 56.Nm netgroup.byhosts 57NIS maps. These reverse netgroup maps are used to help speed up 58netgroup lookups, particularly for the 59.Fn innetgr 60library function. 61.Pp 62For example, the standard 63.Nm /etc/netgroup 64file may list a netgroup and a list of its members. Here, the 65netgroup is considered the 66.Pa key 67and the member names are the 68.Pa data . 69By contrast, the reverse 70.Nm netgroup.byusers 71database lists each unique 72member as the key and the netgroups to which the members belong become 73the data. Seperate databases are created to hold information pertaining 74to users and hosts; this allows netgroup username lookups 75and netgroup hostname lookups to be performed using independent keyspaces. 76.Pp 77By constructing these reverse netgroup databases (and the corresponding 78NIS maps) in advance, the 79.Xr getnetgrent 3 80library functions are spared from having to work out the dependencies 81themselves on the fly. This is important on networks with large numbers 82of users and hosts, since it can take a considerable amount of time 83to process very large netgroup databases. 84.Pp 85The 86.Nm revnetgroup 87command prints its results on the standard output. It is usually called 88only by 89.Nm /var/yp/Makefile 90when rebuilding the NIS netgroup maps. 91.Pp 92.Sh OPTIONS 93The 94.Nm revnetgroup 95command supports the following options: 96.Bl -tag -width flag 97.It Fl u 98Generate netgroup.byuser output; only username information in the 99original netgroup file is processed. 100.It Fl h 101Generate netgroup.byhost output; only hostname information in the 102original netgroup file is processed. (Note at least one of the 103.Fl u 104or 105.Fl h 106flags must be specified.) 107.It Op Fl f Ar netgroup_file 108The 109.Nm revnetgroup 110command uses 111.Nm /etc/netgroup 112as its default input file. The 113.Fl f 114flag allows the user to specify an alternate input file. Specifying ``-'' 115as the input file causes 116.Nm revnetgroup 117to read from the standard input. 118.El 119.Sh FILES 120.Bl -tag -width Pa -compact 121.It Pa /var/yp/Makefile 122The Makefile that calls 123.Nm yp_mkdb 124and 125.Nm revnetgroup 126to build the NIS databases. 127.It Pa /etc/netgroup 128The default netgroup database file. This file is most often found 129only on the NIS master server. 130.El 131.Sh SEE ALSO 132.Xr yp 4 , 133.Xr netgroup 5 , 134.Xr yp_mkdb 8 , 135.Xr getnetgrent 3 136.Sh AUTHOR 137Bill Paul <wpaul@ctr.columbia.edu> 138