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