]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libposix1e/cap.3
o Build and install POSIX.1e capabilities man pages
[FreeBSD/FreeBSD.git] / lib / libposix1e / cap.3
1 .\"-
2 .\" Copyright (c) 2000 Robert N. M. Watson
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\"       $FreeBSD$
27 .\"
28 .\" TrustedBSD Project - support for POSIX.1e process capabilities
29 .\"
30 .Dd April 1, 2000
31 .Dt CAP 3
32 .Os FreeBSD 5.0
33 .Sh NAME
34 .Nm cap
35 .Nd introduction to the POSIX.1e Capability security API
36 .Sh SYNOPSIS
37 .Fd #include <sys/types.h>
38 .Fd #include <sys/cap.h>
39 .Sh DESCRIPTION
40 The POSIX.1e Capability interface allows processes to manipulate their
41 capability set, subject to capability manipulation restrictions imposed
42 by the kernel.  Using the capability API, a process may request a copy
43 of its capability state, modify the copy of the state, and resubmit the
44 state for use, if permitted.
45 .Pp
46 A variety of functions are provided for manipulating and managing
47 process capability state and working store state:
48 .Pp
49 .Fn cap_init
50 .Pp
51 This function is described in
52 .Xr cap_init 3 ,
53 and may be used to allocate a fresh capability structure with no capability
54 flags set.
55 .Pp
56 .Fn cap_clear
57 .Pp
58 This function is described in
59 .Xr cap_clear 3 ,
60 and clears all capability flags in a capability structure.
61 .Pp
62 .Fn cap_dup
63 .Pp
64 This function is described in
65 .Xr cap_dup 3 ,
66 and may be used to duplicate a capability structure.
67 .Pp
68 .Fn cap_free
69 .Pp
70 This function is described in
71 .Xr cap_free 3 ,
72 and may be used to free a capability structure.
73 .Pp
74 .Fn cap_get_flag ,
75 .Fn cap_get_proc
76 .Pp
77 These functions, described in
78 .Xr cap_get_flag 3 ,
79 and
80 .Xr cap_get_proc 3 ,
81 allow retrieval of capability flags from a file, and capability state from
82 the current process.
83 .Pp
84 .Fn cap_set_flag ,
85 .Fn cap_set_proc
86 .Pp
87 These functions, described in
88 .Xr cap_set_flag 3 ,
89 and
90 .Xr cap_set_proc 3 ,
91 allow setting of the capability flags for a file, and capability state for
92 the current process.
93
94 Documentation of the internal kernel interfaces backing these calls may
95 be found in
96 .Xr cap 9 .
97 The syscalls between the internal interfaces and the public library
98 routines may change over time, and as such are not documented.  They are
99 not intended to be called directly without going through the library.
100 .Sh IMPLEMENTATION NOTES
101 FreeBSD's support for POSIX.1e interfaces and features is still under
102 development at this time.
103 .Sh ENVIRONMENT
104 POSIX.1e assigns security labels to all objects, extending the security
105 functionality described in POSIX.1.  These additional labels provide
106 fine-grained discretionary access control, fine-grained capabilities,
107 and labels necessary for mandatory access control.  POSIX.2c describes
108 a set of userland utilities for manipulating these labels.  These userland
109 utilities are not bundled with
110 .Fx 5.0
111 so as to discourage their
112 use in the short term.
113 .\" .Sh FILES
114 .Sh SEE ALSO
115 .Xr cap_clear 3 ,
116 .Xr cap_dup 3 ,
117 .Xr cap_free 3 ,
118 .Xr cap_get_flag 3 ,
119 .Xr cap_get_proc 3 ,
120 .Xr cap_init 3 ,
121 .Xr cap_set_flag 3 ,
122 .Xr cap_set_proc 3 ,
123 .Xr cap 9 ,
124 .Xr posix1e 3
125 .Sh STANDARDS
126 POSIX.1e is described in IEEE POSIX.1e draft 17.  Discussion
127 of the draft continues on the cross-platform POSIX.1e implementation
128 mailing list.  To join this list, see the
129 .Fx 
130 POSIX.1e implementation
131 page for more information.
132 .Sh HISTORY
133 Support for POSIX.1e Capabilities was developed as part of the TrustedBSD
134 Project.
135 POSIX.1e support was introduced in
136 .Fx 4.0 ,
137 and development continues.
138 .Sh AUTHORS
139 .An Robert N M Watson
140 .Sh BUGS
141 These features are not yet included in the base FreeBSD distribution.