2 .\" Copyright (c) 2008-2010 Robert N. M. Watson
3 .\" Copyright (c) 2012-2013 The FreeBSD Foundation
4 .\" All rights reserved.
6 .\" This software was developed at the University of Cambridge Computer
7 .\" Laboratory with support from a grant from Google, Inc.
9 .\" Portions of this documentation were written by Pawel Jakub Dawidek
10 .\" under sponsorship from the FreeBSD Foundation.
12 .\" Redistribution and use in source and binary forms, with or without
13 .\" modification, are permitted provided that the following conditions
15 .\" 1. Redistributions of source code must retain the above copyright
16 .\" notice, this list of conditions and the following disclaimer.
17 .\" 2. Redistributions in binary form must reproduce the above copyright
18 .\" notice, this list of conditions and the following disclaimer in the
19 .\" documentation and/or other materials provided with the distribution.
21 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Dd September 23, 2013
40 .Nd Capsicum capability rights for file descriptors
42 When a file descriptor is created by a function such as
56 it is assigned all capability rights.
57 Those rights can be reduced (but never expanded) by using the
58 .Xr cap_rights_limit 2 ,
59 .Xr cap_fcntls_limit 2 and
60 .Xr cap_ioctls_limit 2
62 Once capability rights are reduced, operations on the file descriptor will be
63 limited to those permitted by rights.
65 The complete list of capability rights is provided below.
68 type is used to store list of capability rights.
71 family of functions should be used to manage the structure.
74 The following rights may be specified in a rights mask:
75 .Bl -tag -width CAP_EXTATTR_DELETE
83 .Xr acl_valid_fd_np 3 .
86 .Xr acl_delete_fd_np 3 .
100 Note that sockets can also become bound implicitly as a result of
104 and that socket options set with
106 may also affect binding behavior.
110 This right has to be present on the directory descriptor.
111 This right includes the
124 with a non-NULL destination address.
128 This right has to be present on the directory descriptor.
129 This right includes the
144 to be used in monitoring the file descriptor for events.
145 .It Dv CAP_EXTATTR_DELETE
147 .Xr extattr_delete_fd 2 .
148 .It Dv CAP_EXTATTR_GET
150 .Xr extattr_get_fd 2 .
151 .It Dv CAP_EXTATTR_LIST
153 .Xr extattr_list_fd 2 .
154 .It Dv CAP_EXTATTR_SET
156 .Xr extattr_set_fd 2 .
167 right is also present.
175 right is also present.
188 right is also present.
203 commands require this capability right.
204 Also note that the list of permitted commands can be further limited with the
205 .Xr cap_fcntls_limit 2
238 Permit UFS background-fsck operations on the descriptor.
246 right is also present.
281 right is also present.
287 .It Dv CAP_GETPEERNAME
290 .It Dv CAP_GETSOCKNAME
293 .It Dv CAP_GETSOCKOPT
299 Be aware that this system call has enormous scope, including potentially
300 global scope for some objects.
301 The list of permitted ioctl commands can be further limited with the
302 .Xr cap_ioctls_limit 2
306 .Dv CAP_KQUEUE_CHANGE
308 .Dv CAP_KQUEUE_EVENT .
309 .It Dv CAP_KQUEUE_CHANGE
314 descriptor that modifies list of monitored events (the
316 argument is non-NULL).
317 .It Dv CAP_KQUEUE_EVENT
322 descriptor that monitors events (the
324 argument is non-NULL).
326 is also required on file descriptors that will be monitored using
333 on the destination directory descriptor.
334 This right includes the
340 not much use (generally) without
343 Permit the file descriptor to be used as a starting directory for calls such as
357 This right includes the
363 This right includes the
369 This right includes the
384 This right includes the
411 This right includes the
427 This right includes the
470 is also required) and related system calls.
477 This right is required on the source directory descriptor.
478 This right includes the
482 Permit operations that seek on the file descriptor, such as
484 but also required for I/O system calls that can read or write at any position
489 .It Dv CAP_SEM_GETVALUE
503 .It Dv CAP_SETSOCKOPT
506 this controls various aspects of socket behavior and may affect binding,
507 connecting, and other behaviors with global scope.
511 closing the socket will also generally shut down any connections on it.
515 This right includes the
519 Allow configuration of TTY hooks, such as
521 on the file descriptor.
527 This right is only required for
529 on the destination directory descriptor if the destination object already
530 exists and will be removed by the rename.
531 This right includes the
550 and related system calls.
553 with a non-NULL connection address,
560 flag, but without the
582 .Xr cap_fcntls_limit 2 ,
583 .Xr cap_ioctls_limit 2 ,
584 .Xr cap_rights_limit 2 ,
588 .Xr extattr_delete_fd 2 ,
589 .Xr extattr_get_fd 2 ,
590 .Xr extattr_list_fd 2 ,
591 .Xr extattr_set_fd 2 ,
650 .Xr acl_delete_fd_np 3 ,
652 .Xr acl_get_fd_np 3 ,
654 .Xr acl_set_fd_np 3 ,
655 .Xr acl_valid_fd_np 3 ,
665 Support for capabilities and capabilities mode was developed as part of the
669 This manual page was created by
670 .An Pawel Jakub Dawidek Aq pawel@dawidek.net
671 under sponsorship from the FreeBSD Foundation based on
674 .An "Robert Watson" Aq rwatson@FreeBSD.org .