xref: /dragonfly/lib/libc/sys/jail_attach.2 (revision 19fe1c42)
1.\"
2.\" Copyright (c) 2005 The DragonFly Project.  All rights reserved.
3.\" This code is derived from software contributed to The DragonFly Project
4.\" by Paul Herman.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\"
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in
14.\"    the documentation and/or other materials provided with the
15.\"    distribution.
16.\" 3. Neither the name of The DragonFly Project nor the names of its
17.\"    contributors may be used to endorse or promote products derived
18.\"    from this software without specific, prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\" $DragonFly: src/lib/libc/sys/jail_attach.2,v 1.4 2006/03/26 22:56:56 swildner Exp $
34.\"
35.Dd January 31, 2005
36.Dt JAIL_ATTACH 2
37.Os
38.Sh NAME
39.Nm jail_attach
40.Nd attach current process to an existing jail
41.Sh LIBRARY
42.Lb libc
43.Sh SYNOPSIS
44.In sys/types.h
45.In sys/jail.h
46.Ft int
47.Fn jail_attach "int id"
48.Sh DESCRIPTION
49The
50.Nm
51system call attaches the current process to an existing jail referenced by
52.Nm id .
53.Pp
54The argument is an int referencing the ID of the prison.
55.Sh ERRORS
56.Fn jail_attach
57will fail if:
58.Bl -tag -width Er
59.It Bq Er EPERM
60The user is not the super user, or is already in a prison.
61.It Bq Er EINVAL
62The prison referenced by
63.Nm id
64does not exist.
65.El
66.Sh SEE ALSO
67.Xr chroot 2 ,
68.Xr jail 2 ,
69.Xr jail 8 ,
70.Xr jexec 8 ,
71.Xr jls 8
72.Sh HISTORY
73The
74.Fn jail_attach
75function call first appeared in
76.Fx 5.1
77and subsequently appeared in
78.Dx 1.1
79.Sh AUTHORS
80The jail_attach man page was written by
81.An Paul Herman .
82