xref: /dflybsd-src/lib/libc/sys/jail_attach.2 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino.\"
286d7f5d3SJohn Marino.\" Copyright (c) 2005 The DragonFly Project.  All rights reserved.
386d7f5d3SJohn Marino.\" This code is derived from software contributed to The DragonFly Project
486d7f5d3SJohn Marino.\" by Paul Herman.
586d7f5d3SJohn Marino.\"
686d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
786d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
886d7f5d3SJohn Marino.\" are met:
986d7f5d3SJohn Marino.\"
1086d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
1186d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
1286d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
1386d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in
1486d7f5d3SJohn Marino.\"    the documentation and/or other materials provided with the
1586d7f5d3SJohn Marino.\"    distribution.
1686d7f5d3SJohn Marino.\" 3. Neither the name of The DragonFly Project nor the names of its
1786d7f5d3SJohn Marino.\"    contributors may be used to endorse or promote products derived
1886d7f5d3SJohn Marino.\"    from this software without specific, prior written permission.
1986d7f5d3SJohn Marino.\"
2086d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2186d7f5d3SJohn Marino.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2286d7f5d3SJohn Marino.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
2386d7f5d3SJohn Marino.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
2486d7f5d3SJohn Marino.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
2586d7f5d3SJohn Marino.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
2686d7f5d3SJohn Marino.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2786d7f5d3SJohn Marino.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2886d7f5d3SJohn Marino.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2986d7f5d3SJohn Marino.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
3086d7f5d3SJohn Marino.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3186d7f5d3SJohn Marino.\" SUCH DAMAGE.
3286d7f5d3SJohn Marino.\"
3386d7f5d3SJohn Marino.\" $DragonFly: src/lib/libc/sys/jail_attach.2,v 1.4 2006/03/26 22:56:56 swildner Exp $
3486d7f5d3SJohn Marino.\"
3586d7f5d3SJohn Marino.Dd January 31, 2005
3686d7f5d3SJohn Marino.Dt JAIL_ATTACH 2
3786d7f5d3SJohn Marino.Os
3886d7f5d3SJohn Marino.Sh NAME
3986d7f5d3SJohn Marino.Nm jail_attach
4086d7f5d3SJohn Marino.Nd attach current process to an existing jail
4186d7f5d3SJohn Marino.Sh LIBRARY
4286d7f5d3SJohn Marino.Lb libc
4386d7f5d3SJohn Marino.Sh SYNOPSIS
4486d7f5d3SJohn Marino.In sys/types.h
4586d7f5d3SJohn Marino.In sys/jail.h
4686d7f5d3SJohn Marino.Ft int
4786d7f5d3SJohn Marino.Fn jail_attach "int id"
4886d7f5d3SJohn Marino.Sh DESCRIPTION
4986d7f5d3SJohn MarinoThe
5086d7f5d3SJohn Marino.Nm
5186d7f5d3SJohn Marinosystem call attaches the current process to an existing jail referenced by
5286d7f5d3SJohn Marino.Nm id .
5386d7f5d3SJohn Marino.Pp
5486d7f5d3SJohn MarinoThe argument is an int referencing the ID of the prison.
5586d7f5d3SJohn Marino.Sh ERRORS
5686d7f5d3SJohn Marino.Fn jail_attach
5786d7f5d3SJohn Marinowill fail if:
5886d7f5d3SJohn Marino.Bl -tag -width Er
5986d7f5d3SJohn Marino.It Bq Er EPERM
6086d7f5d3SJohn MarinoThe user is not the super user, or is already in a prison.
6186d7f5d3SJohn Marino.It Bq Er EINVAL
6286d7f5d3SJohn MarinoThe prison referenced by
6386d7f5d3SJohn Marino.Nm id
6486d7f5d3SJohn Marinodoes not exist.
6586d7f5d3SJohn Marino.El
6686d7f5d3SJohn Marino.Sh SEE ALSO
6786d7f5d3SJohn Marino.Xr chroot 2 ,
6886d7f5d3SJohn Marino.Xr jail 2 ,
6986d7f5d3SJohn Marino.Xr jail 8 ,
7086d7f5d3SJohn Marino.Xr jexec 8 ,
7186d7f5d3SJohn Marino.Xr jls 8
7286d7f5d3SJohn Marino.Sh HISTORY
7386d7f5d3SJohn MarinoThe
7486d7f5d3SJohn Marino.Fn jail_attach
7586d7f5d3SJohn Marinofunction call first appeared in
7686d7f5d3SJohn Marino.Fx 5.1
7786d7f5d3SJohn Marinoand subsequently appeared in
7886d7f5d3SJohn Marino.Dx 1.1
7986d7f5d3SJohn Marino.Sh AUTHORS
8086d7f5d3SJohn MarinoThe jail_attach man page was written by
8186d7f5d3SJohn Marino.An Paul Herman .
82