CAP(3)

NAME
cap - introduction to the POSIX.1e Capability security API

SYNOPSIS
#include <sys/types.h>
#include <sys/cap.h>

DESCRIPTION
The POSIX.1e Capability interface allows processes to manipulate their capability set, subject to capability manipulation restrictions imposed by the kernel. Using the capability API, a process may request a copy of its capability state, modify the copy of the state, and resubmit the state for use, if permitted.

A variety of functions are provided for manipulating and managing process capability state and working store state:

cap_init()
    This function is described in cap_init(3), and may be used to allocate a fresh capability structure with no capability flags set.

cap_clear()
    This function is described in cap_clear(3), and clears all capability flags in a capability structure.

cap_dup()
    This function is described in cap_dup(3), and may be used to duplicate a capability structure.

cap_free()
    This function is described in cap_free(3), and may be used to free a capability structure.

cap_get_flag()
    This function, described in cap_get_flag(3), allows retrieval of a capability flag value from capability state in working store.

cap_get_proc()
    This function, described in cap_get_proc(3), allows retrieval of capability state for the current process.

cap_set_flag()
    This function, described in cap_set_flag(3), allows setting of capability flag values in a capability structure held in the working store.

cap_set_proc()
    This function, described in cap_set_proc(3), allows setting of the current process capability state.

Documentation of the internal kernel interfaces backing these calls may be found in cap(9). The syscalls between the internal interfaces and the public library routines may change over time, and as such are not documented. They are not intended to be called directly without going through the library.

IMPLEMENTATION NOTES
FreeBSD's support for POSIX.1e interfaces and features is still under development at this time.

POSIX.1e assigns security labels to all objects, extending the security functionality described in POSIX.1. These additional labels provide fine-grained discretionary access control, fine-grained capabilities, and labels necessary for mandatory access control. POSIX.2c describes a set of userland utilities for manipulating these labels. These userland utilities are not bundled with FreeBSD 5.0 so as to discourage their use in the short term.

SEE ALSO
cap_clear(3), cap_dup(3), cap_free(3), cap_get_flag(3), cap_get_proc(3), cap_init(3), cap_set_flag(3), cap_set_proc(3), cap(9), posix1e(3)

STANDARDS
POSIX.1e is described in IEEE POSIX.1e draft 17. Discussion of the draft continues on the cross-platform POSIX.1e implementation mailing list. To join this list, see the FreeBSD POSIX.1e implementation page for more information.

HISTORY
Support for POSIX.1e Capabilities was developed as part of the TrustedBSD Project. POSIX.1e support was introduced in FreeBSD 4.0, and development continues.

AUTHORS
Robert N M Watson

BUGS
These features are not yet included in the base FreeBSD distribution.