]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/sliplogin/sliplogin.8
vfork -> fork. The child calls execl() which calls malloc(), so
[FreeBSD/FreeBSD.git] / usr.sbin / sliplogin / sliplogin.8
1 .\" Copyright (c) 1990, 1991, 1993
2 .\"     The Regents of the University of California.  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 the University of
15 .\"     California, Berkeley and its contributors.
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 THE REGENTS 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 THE REGENTS 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 .\"     @(#)sliplogin.8 8.2 (Berkeley) 1/5/94
33 .\"
34 .Dd January 5, 1994
35 .Dt SLIPLOGIN 8
36 .Os
37 .Sh NAME
38 .Nm sliplogin
39 .Nd attach a serial line network interface
40 .Sh SYNOPSIS
41 .Nm
42 .Op Ar loginname Op Ar device
43 .Sh DESCRIPTION
44 .Nm Sliplogin
45 is used to turn the terminal line on standard input (or
46 .Ar device )
47 into a Serial Line IP
48 .Pq Tn SLIP
49 link to a remote host.  To do this, the program
50 searches the file
51 .Pa /etc/sliphome/slip.hosts
52 for an entry matching
53 .Ar loginname
54 (which defaults to the current login name if omitted).
55 If a matching entry is found, the line is configured appropriately
56 for slip (8-bit transparent i/o) and converted to
57 .Tn SLIP
58 line discipline using the optional line discipline parameters.
59 .Pp
60 The optional line discipline parameters consist of one or more of
61 the following;
62 .Sq normal ,
63 .Sq compress ,
64 .Sq noicmp ,
65 or
66 .Sq autocomp
67 which correspond respectively to
68 .Sq use normal line discipline
69 (no header compression),
70 .Sq enable VJ header compression ,
71 .Sq throw away ICMP packets ,
72 and
73 .Sq auto enable VJ header compression
74 (only if the remote end of the link also supports it).
75 .Pp
76 Then a shell script is invoked to initialize the slip
77 interface with the appropriate local and remote
78 .Tn IP
79 address,
80 netmask, etc.
81 .Pp
82 The usual initialization script is
83 .Pa /etc/sliphome/slip.login
84 but, if particular hosts need special initialization, the file
85 .Pa /etc/sliphome/slip.login. Ns Ar loginname
86 will be executed instead if it exists.
87 The script is invoked with the parameters
88 .Bl -tag -width slipunit
89 .It Em slipunit
90 The unit number of the slip interface assigned to this line.  E.g.,
91 .Sy 0
92 for
93 .Sy sl0 .
94 .It Em speed
95 The speed of the line.
96 .It Em args
97 The arguments from the
98 .Pa /etc/sliphome/slip.hosts
99 entry, in order starting with
100 .Ar loginname .
101 .El
102 .Pp
103 Only the super-user may attach a network interface.  The interface is
104 automatically detached when the other end hangs up or the
105 .Nm
106 process dies.  If the kernel slip
107 module has been configured for it, all routes through that interface will
108 also disappear at the same time.  If there is other processing a site
109 would like done on hangup, the file
110 .Pa /etc/sliphome/slip.logout
111 or
112 .Pa /etc/sliphome/slip.logout. Ns Ar loginname
113 is executed if it exists.  It is given the same arguments as the login script.
114 .Ss Format of /etc/sliphome/slip.hosts
115 Comments (lines starting with a `#') and blank lines (or started
116 with space) are ignored.
117 Other lines must start with a
118 .Ar loginname
119 but the remaining arguments can be whatever is appropriate for the
120 .Pa  slip.login
121 file that will be executed for that name.
122 Arguments are separated by white space and follow normal
123 .Xr sh 1
124 quoting conventions (however,
125 .Ar loginname
126 cannot be quoted).
127 Usually, lines have the form
128 .Bd -literal -offset indent
129 loginname local-address remote-address netmask opt-args
130 .Ed
131 .Pp
132 where
133 .Em local-address
134 and
135 .Em remote-address
136 are the IP host names or addresses of the local and remote ends of the
137 slip line and
138 .Em netmask
139 is the appropriate IP netmask.  These arguments are passed
140 directly to
141 .Xr ifconfig 8 .
142 .Em Opt-args
143 are optional arguments used to configure the line.
144 .Pp
145 .Sh FreeBSD Additions
146 An additional SLIP configuration file (if present) is
147 .Pa /etc/sliphome/slip.slparms .
148 If particular hosts need different configurations, the file
149 .Pa /etc/sliphome/slip.slparms. Ns Ar loginname
150 will be parsed instead if it exists.
151 .Ss Format of /etc/sliphome/slip.slparms*
152 Comments (lines starting with a `#') and blank lines (or started with
153 space) are ignored.
154 This file contains from one to three numeric parameters separated with spaces,
155 in order:
156 .Ar keepalive ,
157 .Ar outfill
158 and
159 .Ar slunit .
160 .Bl -tag -width keepalive
161 .It Ar keepalive
162 Set SLIP "keep alive" timeout in seconds. If FRAME_END is not received in
163 this amount of time,
164 .Nm
165 closes the line and exits.
166 The default value is no timeout (zero).
167 .It Ar outfill
168 Set SLIP "out fill" timeout in seconds. It forces at least one FRAME_END
169 to be sent during this time period, which is necessary for the "keep alive"
170 timeout on the remote side.
171 The default value is no timeout (zero).
172 .It Ar slunit
173 Set the SLIP unit number directly. Use with caution, because no check is made
174 for two interfaces with same number.
175 By default sliplogin dynamically assigns the unit number.
176 .El
177 .Pp
178 If latter two parameters are omitted, they will not affect the
179 corresponding SLIP configuration.
180 If any of first two parameters is equal to zero, it will not affect
181 the corresponding SLIP configuration.
182 .Sh EXAMPLE
183 The normal use of
184 .Nm
185 is to create a
186 .Pa /etc/passwd
187 entry for each legal, remote slip site with
188 .Nm
189 as the shell for that entry.  E.g.,
190 .Bd -literal
191 Sfoo:ikhuy6:2010:1:slip line to foo:/tmp:/usr/sbin/sliplogin
192 .Ed
193 .Pp
194 (Our convention is to name the account used by remote host
195 .Ar hostname
196 as
197 .Em Shostname . )
198 Then an entry is added to
199 .Pa slip.hosts
200 that looks like:
201 .Pp
202 .Bd -literal -offset indent -compact
203 Sfoo    `hostname`      foo     netmask
204 .Ed
205 .Pp
206 where
207 .Em `hostname`
208 will be evaluated by
209 .Xr sh
210 to the local host name and
211 .Em netmask
212 is the local host IP netmask.
213 .Pp
214 Note that
215 .Nm
216 must be setuid to root and, while not a security hole, moral defectives
217 can use it to place terminal lines in an unusable state and/or deny
218 access to legitimate users of a remote slip line.  To prevent this,
219 .Nm
220 is installed as user
221 .Em root ,
222 group
223 .Em network
224 and mode 4550 so that only members of group
225 .Em network
226 may run
227 .Nm sliplogin .
228 The system administrator should make sure that all legitimate users
229 are a member of the correct group.
230 .Sh DIAGNOSTICS
231 .Nm Sliplogin
232 logs various information to the system log daemon,
233 .Xr syslogd 8 ,
234 with a facility code of
235 .Em daemon .
236 The messages are listed here, grouped by severity level.
237 .Pp
238 .Sy Error Severity
239 .Bl -tag -width Ds -compact
240 .It Sy ioctl (TCGETS): Em reason
241 A
242 .Dv TCGETS
243 .Fn ioctl
244 to get the line parameters failed.
245 .Pp
246 .It Sy ioctl (TCSETS): Em reason
247 A
248 .Dv TCSETS
249 .Fn ioctl
250 to set the line parameters failed.
251 .Pp
252 .It Sy /etc/sliphome/slip.hosts: Em reason
253 The
254 .Pa /etc/sliphome/slip.hosts
255 file could not be opened.
256 .Pp
257 .It Sy access denied for Em user
258 No entry for
259 .Em user
260 was found in
261 .Pa /etc/sliphome/slip.hosts .
262 .El
263 .Pp
264 .Sy Notice Severity
265 .Bl -tag -width Ds -compact
266 .It Sy "attaching slip unit" Em unit Sy for Ar loginname
267 .Tn SLIP
268 unit
269 .Em unit
270 was successfully attached.
271 .El
272 .Sh FILES
273 .Ar /etc/sliphome/slip.hosts
274 list of host login names and parameters.
275 .Pp
276 .Ar /etc/sliphome/slip.login
277 script executed when a connection is made.
278 .Pp
279 .Ar /etc/sliphome/slip.login.loginname
280 script executed when a connection is made by
281 .Ar loginname .
282 .Pp
283 .Ar /etc/sliphome/slip.logout
284 script executed when a connection is lost.
285 .Pp
286 .Ar /etc/sliphome/slip.logout.loginname
287 script executed when a connection is lost by
288 .Ar loginname .
289 .Pp
290 .Ar /etc/sliphome/slip.slparms
291 extra parameters file.
292 .Pp
293 .Ar /etc/sliphome/slip.slparms.loginname
294 extra parameters file for
295 .Ar loginname .
296 .Pp
297 .Ar /var/run/ttyXn.if
298 contains the name of the network interface used by the sliplogin process on
299 .Ar ttyXn .
300 .Pp
301 .Ar /var/run/slX.pid
302 contains the PID of the sliplogin process which is using interface
303 .Ar slX .
304 .Pp
305 .Sh SEE ALSO
306 .Xr slattach 8 ,
307 .Xr syslogd 8 ,
308 .Pa /usr/share/examples/sliplogin
309 .Sh HISTORY
310 The
311 .Nm
312 command
313 .Bt