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