1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
.\"
.\" $Id: capget.2,v 1.4 1999/09/09 16:43:26 morgan Exp $
.\" written by Andrew Morgan <morgan@linux.kernel.org>
.\" may be distributed as per GPL
.\" Modified by David A. Wheeler <dwheeler@ida.org>
.\"
.TH CAPGET 2 "9 Sept 1999" "Linux 2.2" "Linux Programmer's Manual"
.SH NAME
capget, capset \- set/get process capabilities
.SH SYNOPSIS
.B #undef _POSIX_SOURCE
.br
.B #include <sys/capability.h>
.sp
.BI "int capget(cap_user_header_t " header ", cap_user_data_t " data );
.sp
.BI "int capset(cap_user_header_t " header ", const cap_user_data_t " data );
.SH DESCRIPTION
As of Linux 2.2, the power of the superuser (root) has been partitioned into
a set of discrete capabilities.
Every process has a set of effective capabilities identifying
which capabilities (if any) it may currently exercise.
Every process also has a set of inheritable capabilities that may be
passed through an execve(2) and a set of permitted capabilites
that it can make effective or inheritable.
.PP
These two functions are the raw kernel interface for getting and
setting capabilities. Not only are these system calls specific to Linux,
but the kernel API is likely to change and use of
these functions (in particular the format of the
.B cap_user_*_t
types) is subject to change with each kernel revision.
.sp
The portable interfaces are
.IR cap_set_proc (3)
and
.IR cap_get_proc (3);
if possible you should use those interfaces in applications.
If you wish to use the Linux extensions in applications, you should
use the easier-to-use interfaces
.IR capsetp (3)
and
.IR capgetp (3).
.SH "RETURN VALUE"
On success, zero is returned. On error, -1 is returned, and
.I errno
is set appropriately.
.SH ERRORS
.TP
.SB EINVAL
One of the arguments was invalid.
.TP
.SB EPERM
An attempt was made to add a capability to the Permitted set, or to set
a capability in the Effective or Inheritable sets that is not in the
Permitted set.
.SH FURTHER INFORMATION
The portable interface to the capability querying and setting
functions is provided by the
.B libcap
library and is available from here:
.br
.B ftp://linux.kernel.org/pub/linux/libs/security/linux-privs
|