Libinfo-129.4.tar.gz
[apple/libinfo.git] / nis.subproj / ypserv.acl.5
1 .\"     $OpenBSD: ypserv.acl.5,v 1.5 1996/07/04 21:17:15 deraadt Exp $
2 .\" Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
3 .\" 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 Mats O Jansson
16 .\" 4. The name of the author may not be used to endorse or promote products
17 .\"    derived from this software without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
20 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 .\" 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 .Dd July 2, 1994
32 .Dt YPSERV.ACL 5
33 .Os
34 .Sh NAME
35 .Nm ypserv.acl
36 .Nd 
37 .Xr ypserv 8
38 configuration file
39 .Sh DESCRIPTION
40 The 
41 .Nm ypserv.acl
42 file controls which hosts can connect to the
43 .Nm YP
44 server.
45 .Pp
46 The format is more complex than the format for
47 .Xr securenet 5 .
48 The first two verbs on each line controls if the line will
49 .Nm allow
50 or
51 .Nm deny
52 access for a
53 .Nm host ,
54 network
55 .Nm (net)
56 or
57 .Nm all
58 hosts.
59 .Pp
60 The
61 .Nm YP
62 server reads the configuration file and build a list in memory. This list
63 is processed from the beginning for every incomming request. As soon a
64 match is found in the list the search terminates and it returns success
65 or failure depending on 
66 .Nm allow
67 or 
68 .Nm deny .
69 If no match was found in the list success is returned.
70 .Pp
71 If access is denied every call will cause a 
72 .Nm no such domain
73 error for the caller.
74 .Pp
75 There is no default name for this file. Start 
76 .Nm ypserv
77 with a
78 .Ar -a filename
79 to read a file with this format.
80 .Pp
81 The following different syntax can be used:
82 .Pp
83 <
84 .Nm allow|deny
85 >
86 .Nm host
87 <
88 .Nm hostname|ip-address
89 >
90 .Pp
91 If 
92 .Nm hostname
93 has more than one ip address then all will be added to the list.
94 .Pp
95 <
96 .Nm allow|deny
97 >
98 .Nm net
99 <
100 .Nm netname|netnumber
101 >
102 .Op Nm netmask <netname|netnumber>
103 .Pp
104 If
105 .Nm netmask
106 part of the command isn't given then the netmask will be assumed to be a
107 class A, B or C net depending on the net number.
108 .Pp
109 <
110 .Nm allow|deny 
111 >
112 .Nm all
113 .Pp
114 A line containing one of these commands will always match any host.
115 .Sh EXAMPLES
116 .Pp
117 A configuration file might appear as follows:
118 .Bd -literal
119 # This is an example of an access control file to be used by ypserv.
120 #
121 # This file is parsed line by line. First match will terminate the check
122 # of the caller.
123 #
124
125 ###########################################################################
126 # This is the commands that will match a single host
127 #
128 #       allow host <hostname|ip-address>
129 #       deny host <hostname|ip-address>
130 #
131 # To process hostname gethostbyname is called. If the hostname has
132 # multiple ip-addresses all will be added (I hope). ip-address
133 # processed by inet_aton.
134 deny host jodie
135
136 ###########################################################################
137 # This is the commands that will match a network
138 #
139 #       allow net <netname|netnumber> [netmask <netname|netnumber>]
140 #       deny net <netname|netnumber> [netmask <netname|netnumber>]
141 #
142 # To process netname getnetbyname is called, and inet_aton is used for
143 # netnumber. inet_aton both access numbers as 255.255.255.0 and 0xffffff00.
144 #
145 # If netmask isn't given the parser will assume netmask from the first bits
146 # of the network number. So if the network is subneted the you have to add
147 # the netmask. In my case I've got the network 139.58.253.0 at home so too
148 # allow any of my computers to talk with the server I need the following
149 # line
150 #
151 allow net mojathome netmask 255.255.255.0
152
153 ###########################################################################
154 # At last we have a command that will match any caller:
155 #
156 #       allow all 
157 #       deny all
158 #
159
160 # reject all connections
161 deny all
162
163 .Ed
164 .Sh FILES
165 .Bl -tag -width /var/yp/ypserv.acl -compact
166 .It Pa /var/yp/ypserv.acl
167 A
168 .Xr ypserv 8
169 configuration file.
170 .El
171 .Sh SEE ALSO
172 .Xr yp 8 ,
173 .Xr ypserv 8 ,
174 .Xr securenet 5
175 .Sh AUTHOR
176 Mats O Jansson <moj@stacken.kth.se>
177