Merge branch 'vendor/GREP'
[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. 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 .\" $DragonFly: src/sbin/mount_portal/mount_portal.8,v 1.2 2003/06/17 04:27:33 dillon Exp $
40 .\"
41 .Dd March 27, 1994
42 .Dt MOUNT_PORTAL 8
43 .Os
44 .Sh NAME
45 .Nm mount_portal
46 .Nd mount the portal daemon
47 .Sh SYNOPSIS
48 .Nm
49 .Op Fl o Ar options
50 .Ar /etc/portal.conf
51 .Ar mount_point
52 .Sh DESCRIPTION
53 The
54 .Nm
55 command attaches an instance of the portal daemon
56 to the global filesystem namespace.
57 The conventional mount point is
58 .Pa /p .
59 .\" .PA /dev .
60 This command is normally executed by
61 .Xr mount 8
62 at boot time.
63 .Pp
64 The options are as follows:
65 .Bl -tag -width indent
66 .It Fl o
67 Options are specified with a
68 .Fl o
69 flag followed by a comma separated string of options.
70 See the
71 .Xr mount 8
72 man page for possible options and their meanings.
73 .El
74 .Pp
75 The portal daemon provides an
76 .Em open
77 service.
78 Objects opened under the portal mount point are
79 dynamically created by the portal daemon according
80 to rules specified in the named configuration file.
81 Using this mechanism allows descriptors such as sockets
82 to be made available in the filesystem namespace.
83 .Pp
84 The portal daemon works by being passed the full pathname
85 of the object being opened.
86 The daemon creates an appropriate descriptor according
87 to the rules in the configuration file, and then passes the descriptor back
88 to the calling process as the result of the open system call.
89 .Sh NAMESPACE
90 By convention, the portal daemon divides the namespace into sub-namespaces,
91 each of which handles objects of a particular type.
92 .Pp
93 The following sub-namespaces are currently implemented:
94 .Pa tcplisten ,
95 .Pa tcp
96 and
97 .Pa fs .
98 The
99 .Pa tcplisten
100 namespace takes a slash separated hostname and port and creates a TCP/IP
101 socket bound to the given hostname-port pair.
102 The hostname may be
103 specified as "ANY" to allow any other host to connect to the socket.
104 A
105 port number of 0 will dynamically allocate a port, this can be
106 discovered by calling
107 .Xr getsockname 2
108 with the returned file descriptor.
109 Privileged ports can only be bound to
110 by the super-user.
111 The
112 .Pa tcp
113 namespace takes a hostname and a port (slash separated) and
114 creates an open TCP/IP connection.
115 The
116 .Pa fs
117 namespace opens the named file, starting back at the root directory.
118 This can be used to provide a controlled escape path from
119 a chrooted environment.
120 .Sh "CONFIGURATION FILE"
121 The configuration file contains a list of rules.
122 Each rule takes one line and consists of two or more
123 whitespace separated fields.
124 A hash (``#'') character causes the remainder of a line to
125 be ignored.  Blank lines are ignored.
126 .Pp
127 The first field is a pathname prefix to match
128 against the requested pathname.
129 If a match is found, the second field
130 tells the daemon what type of object to create.
131 Subsequent fields are passed to the creation function.
132 .Bd -literal
133 # @(#)portal.conf       5.1 (Berkeley) 7/13/92
134 tcplisten/      tcplisten tcplisten/
135 tcp/            tcp tcp/
136 fs/             file fs/
137 .Ed
138 .Sh FILES
139 .Bl -tag -width /p/* -compact
140 .It Pa /p/*
141 .El
142 .Sh SEE ALSO
143 .Xr mount 2 ,
144 .Xr unmount 2 ,
145 .Xr fstab 5 ,
146 .Xr mount 8
147 .Sh CAVEATS
148 This filesystem may not be NFS-exported.
149 .Sh HISTORY
150 The
151 .Nm
152 utility first appeared in
153 .Bx 4.4 .