Initial import from FreeBSD RELENG_4:
[games.git] / sbin / mount_portal / mount_portal.8
1 .\"
2 .\" Copyright (c) 1993, 1994
3 .\"     The Regents of the University of California.  All rights reserved.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software donated to Berkeley by
7 .\" Jan-Simon Pendry.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\"    must display the following acknowledgement:
19 .\"     This product includes software developed by the University of
20 .\"     California, Berkeley and its contributors.
21 .\" 4. Neither the name of the University nor the names of its contributors
22 .\"    may be used to endorse or promote products derived from this software
23 .\"    without specific prior written permission.
24 .\"
25 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" SUCH DAMAGE.
36 .\"
37 .\"     @(#)mount_portal.8      8.3 (Berkeley) 3/27/94
38 .\" $FreeBSD: src/sbin/mount_portal/mount_portal.8,v 1.8.2.2 2001/12/20 16:41:47 ru Exp $
39 .\"
40 .Dd March 27, 1994
41 .Dt MOUNT_PORTAL 8
42 .Os
43 .Sh NAME
44 .Nm mount_portal
45 .Nd mount the portal daemon
46 .Sh SYNOPSIS
47 .Nm
48 .Op Fl o Ar options
49 .Ar /etc/portal.conf
50 .Ar mount_point
51 .Sh DESCRIPTION
52 The
53 .Nm
54 command attaches an instance of the portal daemon
55 to the global filesystem namespace.
56 The conventional mount point is
57 .Pa /p .
58 .\" .PA /dev .
59 This command is normally executed by
60 .Xr mount 8
61 at boot time.
62 .Pp
63 The options are as follows:
64 .Bl -tag -width indent
65 .It Fl o
66 Options are specified with a
67 .Fl o
68 flag followed by a comma separated string of options.
69 See the
70 .Xr mount 8
71 man page for possible options and their meanings.
72 .El
73 .Pp
74 The portal daemon provides an
75 .Em open
76 service.
77 Objects opened under the portal mount point are
78 dynamically created by the portal daemon according
79 to rules specified in the named configuration file.
80 Using this mechanism allows descriptors such as sockets
81 to be made available in the filesystem namespace.
82 .Pp
83 The portal daemon works by being passed the full pathname
84 of the object being opened.
85 The daemon creates an appropriate descriptor according
86 to the rules in the configuration file, and then passes the descriptor back
87 to the calling process as the result of the open system call.
88 .Sh NAMESPACE
89 By convention, the portal daemon divides the namespace into sub-namespaces,
90 each of which handles objects of a particular type.
91 .Pp
92 The following sub-namespaces are currently implemented:
93 .Pa tcplisten ,
94 .Pa tcp
95 and
96 .Pa fs .
97 The
98 .Pa tcplisten
99 namespace takes a slash separated hostname and port and creates a TCP/IP
100 socket bound to the given hostname-port pair.
101 The hostname may be
102 specified as "ANY" to allow any other host to connect to the socket.
103 A
104 port number of 0 will dynamically allocate a port, this can be
105 discovered by calling
106 .Xr getsockname 2
107 with the returned file descriptor.
108 Privileged ports can only be bound to
109 by the super-user.
110 The
111 .Pa tcp
112 namespace takes a hostname and a port (slash separated) and
113 creates an open TCP/IP connection.
114 The
115 .Pa fs
116 namespace opens the named file, starting back at the root directory.
117 This can be used to provide a controlled escape path from
118 a chrooted environment.
119 .Sh "CONFIGURATION FILE"
120 The configuration file contains a list of rules.
121 Each rule takes one line and consists of two or more
122 whitespace separated fields.
123 A hash (``#'') character causes the remainder of a line to
124 be ignored.  Blank lines are ignored.
125 .Pp
126 The first field is a pathname prefix to match
127 against the requested pathname.
128 If a match is found, the second field
129 tells the daemon what type of object to create.
130 Subsequent fields are passed to the creation function.
131 .Bd -literal
132 # @(#)portal.conf       5.1 (Berkeley) 7/13/92
133 tcplisten/      tcplisten tcplisten/
134 tcp/            tcp tcp/
135 fs/             file fs/
136 .Ed
137 .Sh FILES
138 .Bl -tag -width /p/* -compact
139 .It Pa /p/*
140 .El
141 .Sh SEE ALSO
142 .Xr mount 2 ,
143 .Xr unmount 2 ,
144 .Xr fstab 5 ,
145 .Xr mount 8
146 .Sh CAVEATS
147 This filesystem may not be NFS-exported.
148 .Sh HISTORY
149 The
150 .Nm
151 utility first appeared in
152 .Bx 4.4 .