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