]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/posix1e/cap.3
This commit was generated by cvs2svn to compensate for changes in r69482,
[FreeBSD/FreeBSD.git] / lib / libc / posix1e / 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 .Bl -tag -width cap_get_flagXX
49 .It Fn cap_init
50 This function is described in
51 .Xr cap_init 3 ,
52 and may be used to allocate a fresh capability structure with no capability
53 flags set.
54 .It Fn cap_clear
55 This function is described in
56 .Xr cap_clear 3 ,
57 and clears all capability flags in a capability structure.
58 .It Fn cap_dup
59 This function is described in
60 .Xr cap_dup 3 ,
61 and may be used to duplicate a capability structure.
62 .It Fn cap_free
63 This function is described in
64 .Xr cap_free 3 ,
65 and may be used to free a capability structure.
66 .It Fn cap_get_flag
67 This function, described in
68 .Xr cap_get_flag 3 ,
69 allows retrieval of a capability flag value from capability state in
70 working store.
71 .It Fn cap_get_proc
72 This function, described in
73 .Xr cap_get_proc 3 ,
74 allows retrieval of capability state for the current process.
75 .It Fn cap_set_flag
76 This function, described in
77 .Xr cap_set_flag 3 ,
78 allows setting of capability flag values in a capability structure held
79 in the working store.
80 .It Fn cap_set_proc
81 This function, described in
82 .Xr cap_set_proc 3 ,
83 allows setting of the current process capability state.
84 .El
85 .Pp
86 Documentation of the internal kernel interfaces backing these calls may
87 be found in
88 .Xr cap 9 .
89 The syscalls between the internal interfaces and the public library
90 routines may change over time, and as such are not documented.  They are
91 not intended to be called directly without going through the library.
92 .Sh IMPLEMENTATION NOTES
93 FreeBSD's support for POSIX.1e interfaces and features is still under
94 development at this time.
95 .Pp
96 POSIX.1e assigns security labels to all objects, extending the security
97 functionality described in POSIX.1.  These additional labels provide
98 fine-grained discretionary access control, fine-grained capabilities,
99 and labels necessary for mandatory access control.  POSIX.2c describes
100 a set of userland utilities for manipulating these labels.  These userland
101 utilities are not bundled with
102 .Fx 5.0
103 so as to discourage their
104 use in the short term.
105 .\" .Sh FILES
106 .Sh SEE ALSO
107 .Xr cap_clear 3 ,
108 .Xr cap_dup 3 ,
109 .Xr cap_free 3 ,
110 .Xr cap_get_flag 3 ,
111 .Xr cap_get_proc 3 ,
112 .Xr cap_init 3 ,
113 .Xr cap_set_flag 3 ,
114 .Xr cap_set_proc 3 ,
115 .Xr cap 9 ,
116 .Xr posix1e 3
117 .Sh STANDARDS
118 POSIX.1e is described in IEEE POSIX.1e draft 17.  Discussion
119 of the draft continues on the cross-platform POSIX.1e implementation
120 mailing list.  To join this list, see the
121 .Fx 
122 POSIX.1e implementation
123 page for more information.
124 .Sh HISTORY
125 Support for POSIX.1e Capabilities was developed as part of the TrustedBSD
126 Project.
127 POSIX.1e support was introduced in
128 .Fx 4.0 ,
129 and development continues.
130 .Sh AUTHORS
131 .An Robert N M Watson
132 .Sh BUGS
133 These features are not yet included in the base FreeBSD distribution.