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