2009-12-05 23:34:28 +03:00
|
|
|
.\" $NetBSD: mount_portal.8,v 1.21 2009/12/05 20:34:28 pooka Exp $
|
1994-01-12 23:01:27 +03:00
|
|
|
.\"
|
1994-06-08 23:23:02 +04:00
|
|
|
.\" Copyright (c) 1993, 1994
|
1994-01-12 23:01:27 +03:00
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software donated to Berkeley by
|
|
|
|
.\" Jan-Simon Pendry.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
2003-08-07 14:04:22 +04:00
|
|
|
.\" 3. Neither the name of the University nor the names of its contributors
|
1994-01-12 23:01:27 +03:00
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
1995-03-18 17:54:19 +03:00
|
|
|
.\" @(#)mount_portal.8 8.3 (Berkeley) 3/27/94
|
1994-01-12 23:01:27 +03:00
|
|
|
.\"
|
2009-12-05 23:34:28 +03:00
|
|
|
.Dd December 5, 2009
|
1994-01-12 23:01:27 +03:00
|
|
|
.Dt MOUNT_PORTAL 8
|
2001-06-05 15:22:41 +04:00
|
|
|
.Os
|
1994-01-12 23:01:27 +03:00
|
|
|
.Sh NAME
|
|
|
|
.Nm mount_portal
|
|
|
|
.Nd mount the portal daemon
|
|
|
|
.Sh SYNOPSIS
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm
|
1994-06-08 23:23:02 +04:00
|
|
|
.Op Fl o Ar options
|
|
|
|
.Ar /etc/portal.conf
|
|
|
|
.Ar mount_point
|
1994-01-12 23:01:27 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
1997-09-15 09:58:22 +04:00
|
|
|
.Nm
|
1994-01-12 23:01:27 +03:00
|
|
|
command attaches an instance of the portal daemon
|
|
|
|
to the global filesystem namespace.
|
|
|
|
The conventional mount point is
|
|
|
|
.Pa /p .
|
2005-01-31 08:19:18 +03:00
|
|
|
The directory specified by
|
|
|
|
.Ar mount_point
|
|
|
|
is converted to an absolute path before use.
|
1994-01-12 23:01:27 +03:00
|
|
|
This command is normally executed by
|
|
|
|
.Xr mount 8
|
|
|
|
at boot time.
|
|
|
|
.Pp
|
1994-06-08 23:23:02 +04:00
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Fl o
|
|
|
|
Options are specified with a
|
|
|
|
.Fl o
|
|
|
|
flag followed by a comma separated string of options.
|
|
|
|
See the
|
|
|
|
.Xr mount 8
|
|
|
|
man page for possible options and their meanings.
|
|
|
|
.El
|
|
|
|
.Pp
|
1994-01-12 23:01:27 +03:00
|
|
|
The portal daemon provides an
|
|
|
|
.Em open
|
|
|
|
service.
|
|
|
|
Objects opened under the portal mount point are
|
|
|
|
dynamically created by the portal daemon according
|
|
|
|
to rules specified in the named configuration file.
|
|
|
|
Using this mechanism allows descriptors such as sockets
|
|
|
|
to be made available in the filesystem namespace.
|
|
|
|
.Pp
|
|
|
|
The portal daemon works by being passed the full pathname
|
|
|
|
of the object being opened.
|
|
|
|
The daemon creates an appropriate descriptor according
|
|
|
|
to the rules in the configuration file, and then passes the descriptor back
|
|
|
|
to the calling process as the result of the open system call.
|
|
|
|
.Sh NAMESPACE
|
|
|
|
By convention, the portal daemon divides the namespace into sub-namespaces,
|
|
|
|
each of which handles objects of a particular type.
|
|
|
|
.Pp
|
1999-08-16 10:55:27 +04:00
|
|
|
Currently, four sub-namespaces are implemented:
|
2000-11-06 16:53:53 +03:00
|
|
|
.Pa tcp ,
|
|
|
|
.Pa fs ,
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa rfilter
|
1994-01-12 23:01:27 +03:00
|
|
|
and
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa wfilter .
|
1994-01-12 23:01:27 +03:00
|
|
|
The
|
|
|
|
.Pa tcp
|
|
|
|
namespace takes a hostname and a port (slash separated) and
|
|
|
|
creates an open TCP/IP connection.
|
|
|
|
The
|
|
|
|
.Pa fs
|
|
|
|
namespace opens the named file, starting back at the root directory.
|
|
|
|
This can be used to provide a controlled escape path from
|
|
|
|
a chrooted environment.
|
2001-11-16 15:01:22 +03:00
|
|
|
.Pp
|
1999-08-16 10:55:27 +04:00
|
|
|
The
|
|
|
|
.Pa rfilter
|
2001-11-16 13:25:42 +03:00
|
|
|
and
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa wfilter
|
|
|
|
namespaces open a pipe to a process, typically a data-filter such
|
2002-10-01 17:40:23 +04:00
|
|
|
as compression or decompression programs.
|
|
|
|
The
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa rfilter
|
|
|
|
namespace opens a read-only pipe, while the
|
|
|
|
.Pa wfilter
|
2002-10-01 17:40:23 +04:00
|
|
|
namespace opens a write-only pipe.
|
2002-10-01 17:52:49 +04:00
|
|
|
See the
|
|
|
|
.Sx EXAMPLES
|
|
|
|
section below for more examples.
|
2001-11-16 15:01:22 +03:00
|
|
|
.Sh CONFIGURATION FILE
|
1994-01-12 23:01:27 +03:00
|
|
|
The configuration file contains a list of rules.
|
|
|
|
Each rule takes one line and consists of two or more
|
|
|
|
whitespace separated fields.
|
2002-10-01 17:52:49 +04:00
|
|
|
A hash
|
|
|
|
.Pq Dq #
|
|
|
|
character causes the remainder of a line to be ignored.
|
2002-10-01 17:40:23 +04:00
|
|
|
Blank lines are ignored.
|
1994-01-12 23:01:27 +03:00
|
|
|
.Pp
|
|
|
|
The first field is a pathname prefix to match
|
|
|
|
against the requested pathname.
|
|
|
|
If a match is found, the second field
|
|
|
|
tells the daemon what type of object to create.
|
|
|
|
Subsequent fields are passed to the creation function.
|
2001-11-16 15:01:22 +03:00
|
|
|
.Pp
|
1999-08-16 10:55:27 +04:00
|
|
|
The
|
|
|
|
.Pa rfilter
|
2001-11-16 13:25:42 +03:00
|
|
|
and
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa wfilter
|
|
|
|
namespaces have additional meanings for the remaining fields.
|
|
|
|
The third field specifies a prefix that is to be stripped off of
|
2002-10-01 17:40:23 +04:00
|
|
|
the passed name before passing it on to the pipe program.
|
|
|
|
If the prefix does not match, no stripping is performed.
|
|
|
|
The fourth argument specifies the program to use for the pipe.
|
|
|
|
Any remaining fields are passed to the pipe program.
|
|
|
|
If the string
|
1999-08-16 10:55:27 +04:00
|
|
|
.Dq Li "%s"
|
|
|
|
exists within these remaining fields, it will be replaced by the
|
2002-10-01 17:40:23 +04:00
|
|
|
path after stripping is performed.
|
|
|
|
If there is no field after the program name,
|
1999-08-16 10:55:27 +04:00
|
|
|
.Dq Li "%s"
|
2001-11-16 13:25:42 +03:00
|
|
|
will be assumed, to maintain similarity with the
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa tcp
|
2001-11-16 13:25:42 +03:00
|
|
|
and
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa fs
|
|
|
|
namespaces.
|
2001-11-16 15:01:22 +03:00
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /p/* -compact
|
|
|
|
.It Pa /p/*
|
|
|
|
.El
|
1999-08-16 10:55:27 +04:00
|
|
|
.Sh EXAMPLES
|
|
|
|
A tutorial and several examples are provided in
|
2002-10-01 17:52:49 +04:00
|
|
|
.Pa /usr/share/examples/mount_portal .
|
2002-10-01 17:40:23 +04:00
|
|
|
The following is an example configuration file.
|
2001-11-16 15:01:22 +03:00
|
|
|
.Pp
|
1994-01-12 23:01:27 +03:00
|
|
|
.Bd -literal
|
|
|
|
# @(#)portal.conf 5.1 (Berkeley) 7/13/92
|
|
|
|
tcp/ tcp tcp/
|
|
|
|
fs/ file fs/
|
1999-08-16 10:55:27 +04:00
|
|
|
echo/ rfilter echo/ echo %s
|
|
|
|
echo_nostrip/ rfilter nostrip echo %s
|
|
|
|
echo_noslash rfilter echo_noslash echo %s
|
|
|
|
gzcat/ rfilter gzcat/ gzcat %s
|
2002-02-08 04:21:55 +03:00
|
|
|
gzip/ wfilter gzip/ gzip \*[Gt] %s
|
|
|
|
gzip9/ wfilter gzip9/ gzip -9 \*[Gt] %s
|
1999-08-16 10:55:27 +04:00
|
|
|
ftp/ rfilter ftp/ ftp -Vo - %s
|
|
|
|
ftp:// rfilter nostrip ftp -Vo - %s
|
|
|
|
http:// rfilter nostrip ftp -Vo - %s
|
|
|
|
bzcat/ rfilter bzcat/ bzcat %s
|
|
|
|
nroff/ rfilter nroff/ nroff -man %s
|
|
|
|
.Ed
|
2001-11-16 15:01:22 +03:00
|
|
|
.Pp
|
2002-10-01 17:52:49 +04:00
|
|
|
As is true with many other filesystems, a weird sense of humor is handy.
|
2001-11-16 15:01:22 +03:00
|
|
|
.Pp
|
1999-08-16 10:55:27 +04:00
|
|
|
Notice that after the keynames, like nroff/ and bzcat/, we
|
2002-10-01 17:40:23 +04:00
|
|
|
typically use another slash.
|
|
|
|
In reality, the
|
1999-08-16 10:55:27 +04:00
|
|
|
.Nm
|
2002-10-01 17:52:49 +04:00
|
|
|
process changes directory to
|
|
|
|
.Pa / ,
|
|
|
|
which makes the subsequent slash unnecessary.
|
2002-10-01 17:40:23 +04:00
|
|
|
However, the extra slash provides a visual hint
|
|
|
|
that we are not operating on an ordinary file.
|
|
|
|
An alternative would be to change the configuration
|
|
|
|
file to something like:
|
1999-08-16 10:55:27 +04:00
|
|
|
.Bd -literal
|
|
|
|
nroff% rfilter nroff% nroff -man
|
|
|
|
.Ed
|
2001-11-16 15:01:22 +03:00
|
|
|
.Pp
|
1999-08-16 10:55:27 +04:00
|
|
|
One might then use
|
|
|
|
.Bd -literal
|
|
|
|
less /p/nroff%/usr/share/man/man8/mount_portal.8
|
1994-01-12 23:01:27 +03:00
|
|
|
.Ed
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr mount 2 ,
|
|
|
|
.Xr unmount 2 ,
|
1994-06-08 23:23:02 +04:00
|
|
|
.Xr fstab 5 ,
|
|
|
|
.Xr mount 8
|
1994-01-12 23:01:27 +03:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
1997-09-15 09:58:22 +04:00
|
|
|
.Nm
|
1998-02-06 08:54:12 +03:00
|
|
|
utility first appeared in
|
2001-11-16 15:01:22 +03:00
|
|
|
.Bx 4.4 .
|
|
|
|
The
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa rfilter
|
2001-11-16 13:25:42 +03:00
|
|
|
and
|
1999-08-16 10:55:27 +04:00
|
|
|
.Pa wfilter
|
|
|
|
capabilities first appeared in
|
|
|
|
.Nx 1.5 .
|
2009-12-05 23:34:28 +03:00
|
|
|
The portal kernel driver was removed and
|
|
|
|
.Nm
|
|
|
|
was converted to use
|
|
|
|
.Xr puffs 3
|
|
|
|
in
|
|
|
|
.Nx 6.0 .
|
2001-11-16 15:01:22 +03:00
|
|
|
.Sh BUGS
|
|
|
|
This filesystem may not be NFS-exported.
|