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
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.
73 The following rights may be specified in a rights mask:
74 .Bl -tag -width CAP_RENAMEAT_SOURCE
82 .Xr acl_valid_fd_np 3 .
85 .Xr acl_delete_fd_np 3 .
99 Note that sockets can also become bound implicitly as a result of
103 and that socket options set with
105 may also affect binding behavior.
109 This right has to be present on the directory descriptor.
110 This right includes the
123 with a non-NULL destination address.
127 This right has to be present on the directory descriptor.
128 This right includes the
143 to be used in monitoring the file descriptor for events.
144 .It Dv CAP_EXTATTR_DELETE
146 .Xr extattr_delete_fd 2 .
147 .It Dv CAP_EXTATTR_GET
149 .Xr extattr_get_fd 2 .
150 .It Dv CAP_EXTATTR_LIST
152 .Xr extattr_list_fd 2 .
153 .It Dv CAP_EXTATTR_SET
155 .Xr extattr_set_fd 2 .
166 right is also present.
174 right is also present.
187 right is also present.
202 commands require this capability right.
203 Also note that the list of permitted commands can be further limited with the
204 .Xr cap_fcntls_limit 2
237 Permit UFS background-fsck operations on the descriptor.
245 right is also present.
285 right is also present.
291 .It Dv CAP_GETPEERNAME
294 .It Dv CAP_GETSOCKNAME
297 .It Dv CAP_GETSOCKOPT
303 Be aware that this system call has enormous scope, including potentially
304 global scope for some objects.
305 The list of permitted ioctl commands can be further limited with the
306 .Xr cap_ioctls_limit 2
310 .Dv CAP_KQUEUE_CHANGE
312 .Dv CAP_KQUEUE_EVENT .
313 .It Dv CAP_KQUEUE_CHANGE
318 descriptor that modifies list of monitored events (the
320 argument is non-NULL).
321 .It Dv CAP_KQUEUE_EVENT
326 descriptor that monitors events (the
328 argument is non-NULL).
330 is also required on file descriptors that will be monitored using
332 .It Dv CAP_LINKAT_SOURCE
335 on the source directory descriptor.
336 This right includes the
341 .Dv CAP_LINKAT_SOURCE
342 makes it possible to link files in a directory for which file
343 descriptors exist that have additional rights.
345 a file stored in a directory that does not allow
347 may be linked in another directory that does allow
349 thereby granting read access to a file that is otherwise unreadable.
350 .It Dv CAP_LINKAT_TARGET
353 on the target directory descriptor.
354 This right includes the
360 not much use (generally) without
363 Permit the file descriptor to be used as a starting directory for calls such as
377 This right includes the
383 This right includes the
389 This right includes the
404 This right includes the
431 This right includes the
447 This right includes the
490 is also required) and related system calls.
494 .It Dv CAP_RENAMEAT_SOURCE
497 on the source directory descriptor.
498 This right includes the
503 .Dv CAP_RENAMEAT_SOURCE
504 makes it possible to move files to a directory for which file
505 descriptors exist that have additional rights.
507 a file stored in a directory that does not allow
509 may be moved to another directory that does allow
511 thereby granting read access to a file that is otherwise unreadable.
512 .It Dv CAP_RENAMEAT_TARGET
515 on the target directory descriptor.
516 This right includes the
520 Permit operations that seek on the file descriptor, such as
522 but also required for I/O system calls that can read or write at any position
527 .It Dv CAP_SEM_GETVALUE
541 .It Dv CAP_SETSOCKOPT
544 this controls various aspects of socket behavior and may affect binding,
545 connecting, and other behaviors with global scope.
549 closing the socket will also generally shut down any connections on it.
553 This right includes the
557 Allow configuration of TTY hooks, such as
559 on the file descriptor.
565 This right is only required for
567 on the destination directory descriptor if the destination object already
568 exists and will be removed by the rename.
569 This right includes the
588 and related system calls.
591 with a non-NULL connection address,
598 flag, but without the
620 .Xr cap_fcntls_limit 2 ,
621 .Xr cap_ioctls_limit 2 ,
622 .Xr cap_rights_limit 2 ,
626 .Xr extattr_delete_fd 2 ,
627 .Xr extattr_get_fd 2 ,
628 .Xr extattr_list_fd 2 ,
629 .Xr extattr_set_fd 2 ,
688 .Xr acl_delete_fd_np 3 ,
690 .Xr acl_get_fd_np 3 ,
692 .Xr acl_set_fd_np 3 ,
693 .Xr acl_valid_fd_np 3 ,
703 Support for capabilities and capabilities mode was developed as part of the
708 This manual page was created by
709 .An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net
710 under sponsorship from the FreeBSD Foundation based on the
713 .An Robert Watson Aq Mt rwatson@FreeBSD.org .