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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
.\"
.\" $Id: cap_clear.3,v 1.1.1.1 1999/04/17 22:16:31 morgan Exp $
.\"
.TH CAP_CLEAR 3 "26th May 1997" "" "Linux Programmer's Manual"
.SH NAME
cap_clear, cap_get_flag, cap_set_flag \- capability data object manipulation
.SH SYNOPSIS
.B #include <sys/capability.h>
.sp
.BI "int cap_clear(cap_t " cap_p );
.sp
.BI "int cap_get_flag(cap_t " cap_p ", cap_value_t " cap ", cap_flag_t " flag ", cap_flag_value_t *" value_p ");"
.sp
.BI "int cap_set_flag(cap_t " cap_p ", cap_flag_t " flag ", int " ncap ", cap_value_t *" caps ", cap_flag_value_t " value ");"
.SH USAGE
.B cc ... -lcap
.SH DESCRIPTION
.B cap_clear
initializes the capability state in working storage identified by
.I cap_p
in such a way that all capability flags are cleared.
.PP
.B cap_get_flag
obtains the current value of the capability flag,
.IR flag ,
of the capability,
.IR cap ,
from the capability state identified by
.I cap_p
and places it in the location pointed to by
.IR value_p .
.PP
.B cap_set_flag
sets the flag,
.IR flag ,
of each capability in the array
.I caps
in the capability state identified by
.I cap_p
to
.IR value .
The argument,
.IR ncap ,
is used to specify the number of capabilities in the array,
.IR caps .
.PP
A
.B cap_value_t
can identify any capability, such as
.BR CAP_CHOWN .
A
.B cap_flag_t
can be set to
.BR CAP_EFFECTIVE ,
.B CAP_INHERITABLE
or
.BR CAP_PERMITTED .
A
.B cap_flag_value_t
can be
.B CAP_CLEAR
(0) or
.B CAP_SET
(1).
.SH "RETURN VALUE"
.BR cap_clear ,
.B cap_get_flag
and
.B cap_set_flag
return zero on success, and \-1 on failure.
.PP
On failure,
.BR errno (3)
is set to
.BR EINVAL ,
indicating that one of the arguments is invalid.
.SH "CONFORMING TO"
These functions are specified by POSIX.1e.
.SH "SEE ALSO"
.IR cap_copy_ext (3),
.IR cap_from_text (3),
.IR cap_get_file (3),
.IR cap_get_proc (3),
.IR cap_init (3)
|