xref: /freebsd/libexec/revnetgroup/revnetgroup.8 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1a44e4d14SBill Paul.\" Copyright (c) 1995
2a44e4d14SBill Paul.\"	Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
3a44e4d14SBill Paul.\"
4a44e4d14SBill Paul.\" Redistribution and use in source and binary forms, with or without
5a44e4d14SBill Paul.\" modification, are permitted provided that the following conditions
6a44e4d14SBill Paul.\" are met:
7a44e4d14SBill Paul.\" 1. Redistributions of source code must retain the above copyright
8a44e4d14SBill Paul.\"    notice, this list of conditions and the following disclaimer.
9a44e4d14SBill Paul.\" 2. Redistributions in binary form must reproduce the above copyright
10a44e4d14SBill Paul.\"    notice, this list of conditions and the following disclaimer in the
11a44e4d14SBill Paul.\"    documentation and/or other materials provided with the distribution.
12a44e4d14SBill Paul.\" 3. All advertising materials mentioning features or use of this software
13a44e4d14SBill Paul.\"    must display the following acknowledgement:
14a44e4d14SBill Paul.\"	This product includes software developed by Bill Paul.
15a44e4d14SBill Paul.\" 4. Neither the name of the University nor the names of its contributors
16a44e4d14SBill Paul.\"    may be used to endorse or promote products derived from this software
17a44e4d14SBill Paul.\"    without specific prior written permission.
18a44e4d14SBill Paul.\"
19a44e4d14SBill Paul.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
20a44e4d14SBill Paul.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21a44e4d14SBill Paul.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22a44e4d14SBill Paul.\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
23a44e4d14SBill Paul.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24a44e4d14SBill Paul.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25a44e4d14SBill Paul.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26a44e4d14SBill Paul.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27a44e4d14SBill Paul.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28a44e4d14SBill Paul.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29a44e4d14SBill Paul.\" SUCH DAMAGE.
30a44e4d14SBill Paul.\"
31a44e4d14SBill Paul.Dd October 24, 1995
32a44e4d14SBill Paul.Dt REVNETGROUP 8
33a44e4d14SBill Paul.Os
34a44e4d14SBill Paul.Sh NAME
35a44e4d14SBill Paul.Nm revnetgroup
36a44e4d14SBill Paul.Nd "generate reverse netgroup data"
37a44e4d14SBill Paul.Sh SYNOPSIS
3876081989SRuslan Ermilov.Nm
39ee3b44f5SRuslan Ermilov.Fl u | h
40a44e4d14SBill Paul.Op Fl f Ar netgroup_file
41a44e4d14SBill Paul.Sh DESCRIPTION
423f162cb8SPhilippe CharnierThe
433f162cb8SPhilippe Charnier.Nm
443f162cb8SPhilippe Charnierutility processes the contents of a file in
45a44e4d14SBill Paul.Xr netgroup 5
46a44e4d14SBill Paulformat into what is called
47a44e4d14SBill Paul.Pa reverse netgroup
48c481aa05SRuslan Ermilovform.
49c481aa05SRuslan ErmilovThat is, where the original file shows
50a44e4d14SBill Paulnetgroup memberships in terms of which members reside in a particular
51a44e4d14SBill Paulgroup, the reverse netgroup format specifies what groups are associated
52c481aa05SRuslan Ermilovwith a particular member.
53c481aa05SRuslan ErmilovThis information is used to generate the
543029b69fSPhilippe Charnier.Pa netgroup.byuser
55a44e4d14SBill Pauland
560437688eSNiclas Zeising.Pa netgroup.byhost
573029b69fSPhilippe Charnier.Tn NIS
58c481aa05SRuslan Ermilovmaps.
59c481aa05SRuslan ErmilovThese reverse netgroup maps are used to help speed up
60a44e4d14SBill Paulnetgroup lookups, particularly for the
61a44e4d14SBill Paul.Fn innetgr
62a44e4d14SBill Paullibrary function.
63a44e4d14SBill Paul.Pp
64a44e4d14SBill PaulFor example, the standard
653029b69fSPhilippe Charnier.Pa /etc/netgroup
66c481aa05SRuslan Ermilovfile may list a netgroup and a list of its members.
67c481aa05SRuslan ErmilovHere, the
68a44e4d14SBill Paulnetgroup is considered the
693029b69fSPhilippe Charnier.Em key
70a44e4d14SBill Pauland the member names are the
713029b69fSPhilippe Charnier.Em data .
72a44e4d14SBill PaulBy contrast, the reverse
730437688eSNiclas Zeising.Pa netgroup.byuser
74a44e4d14SBill Pauldatabase lists each unique
75a44e4d14SBill Paulmember as the key and the netgroups to which the members belong become
76c481aa05SRuslan Ermilovthe data.
77c481aa05SRuslan ErmilovSeparate databases are created to hold information pertaining
78a44e4d14SBill Paulto users and hosts; this allows netgroup username lookups
79a44e4d14SBill Pauland netgroup hostname lookups to be performed using independent keyspaces.
80a44e4d14SBill Paul.Pp
81a44e4d14SBill PaulBy constructing these reverse netgroup databases (and the corresponding
823029b69fSPhilippe Charnier.Tn NIS
833029b69fSPhilippe Charniermaps) in advance, the
84a44e4d14SBill Paul.Xr getnetgrent 3
85a44e4d14SBill Paullibrary functions are spared from having to work out the dependencies
86c481aa05SRuslan Ermilovthemselves on the fly.
87c481aa05SRuslan ErmilovThis is important on networks with large numbers
88a44e4d14SBill Paulof users and hosts, since it can take a considerable amount of time
89a44e4d14SBill Paulto process very large netgroup databases.
90a44e4d14SBill Paul.Pp
91a44e4d14SBill PaulThe
923029b69fSPhilippe Charnier.Nm
93c481aa05SRuslan Ermilovutility prints its results on the standard output.
94c481aa05SRuslan ErmilovIt is usually called
95a44e4d14SBill Paulonly by
963029b69fSPhilippe Charnier.Pa /var/yp/Makefile
973029b69fSPhilippe Charnierwhen rebuilding the
983029b69fSPhilippe Charnier.Tn NIS
993029b69fSPhilippe Charniernetgroup maps.
100a44e4d14SBill Paul.Sh OPTIONS
101a44e4d14SBill PaulThe
1023029b69fSPhilippe Charnier.Nm
1033f162cb8SPhilippe Charnierutility supports the following options:
1043029b69fSPhilippe Charnier.Bl -tag -width indent
105a44e4d14SBill Paul.It Fl u
1063029b69fSPhilippe CharnierGenerate
1073029b69fSPhilippe Charnier.Pa netgroup.byuser
1083029b69fSPhilippe Charnieroutput; only username information in the
109a44e4d14SBill Pauloriginal netgroup file is processed.
110a44e4d14SBill Paul.It Fl h
1113029b69fSPhilippe CharnierGenerate
1123029b69fSPhilippe Charnier.Pa netgroup.byhost
1133029b69fSPhilippe Charnieroutput; only hostname information in the
114c481aa05SRuslan Ermilovoriginal netgroup file is processed.
115c481aa05SRuslan Ermilov(Note at least one of the
116a44e4d14SBill Paul.Fl u
117a44e4d14SBill Paulor
118a44e4d14SBill Paul.Fl h
119a44e4d14SBill Paulflags must be specified.)
120a44e4d14SBill Paul.It Op Fl f Ar netgroup_file
121a44e4d14SBill PaulThe
1223029b69fSPhilippe Charnier.Nm
1233f162cb8SPhilippe Charnierutility uses
1243029b69fSPhilippe Charnier.Pa /etc/netgroup
125c481aa05SRuslan Ermilovas its default input file.
126c481aa05SRuslan ErmilovThe
127a44e4d14SBill Paul.Fl f
128c481aa05SRuslan Ermilovflag allows the user to specify an alternate input file.
129c481aa05SRuslan ErmilovSpecifying ``-''
130a44e4d14SBill Paulas the input file causes
1313029b69fSPhilippe Charnier.Nm
132a44e4d14SBill Paulto read from the standard input.
133a44e4d14SBill Paul.El
134a44e4d14SBill Paul.Sh FILES
1353029b69fSPhilippe Charnier.Bl -tag -width /var/yp/Makefile -compact
136a44e4d14SBill Paul.It Pa /var/yp/Makefile
1373029b69fSPhilippe Charnierthe Makefile that calls
138a44e4d14SBill Paul.Nm yp_mkdb
139a44e4d14SBill Pauland
14076081989SRuslan Ermilov.Nm
1413029b69fSPhilippe Charnierto build the
1423029b69fSPhilippe Charnier.Tn NIS
1433029b69fSPhilippe Charnierdatabases
144a44e4d14SBill Paul.It Pa /etc/netgroup
145c481aa05SRuslan Ermilovthe default netgroup database file.
146c481aa05SRuslan ErmilovThis file is most often found
1473029b69fSPhilippe Charnieronly on the
1483029b69fSPhilippe Charnier.Tn NIS
1493029b69fSPhilippe Charniermaster server
150a44e4d14SBill Paul.El
151a44e4d14SBill Paul.Sh SEE ALSO
152af202156SWolfram Schneider.Xr getnetgrent 3 ,
153a44e4d14SBill Paul.Xr netgroup 5 ,
154491a8429SRuslan Ermilov.Xr yp 8 ,
155af202156SWolfram Schneider.Xr yp_mkdb 8
156c92c0f26SPhilippe Charnier.Sh AUTHORS
157*01c2b8acSBaptiste Daroussin.An Bill Paul Aq Mt wpaul@ctr.columbia.edu
158