cap_get_proc, cap_set_proc, cap_set_proc_flags - get or set process
int cap_set_proc(cap_t cap);
int cap_set_proc_flags(cap_value_t flags);
cap_get_proc returns a pointer to an allocated cap_t associated with the
cap_set_proc sets the capabilities for the process from the cap_t cap.
If any flag in cap is set for any capability not currently permitted for
the calling process, the function fails, and the capability state of the
process shall remain unchanged.
cap_set_proc_flags sets the capability state flags for the process from
the cap_value_t flags. If the value of flags is CAP_FLAG_PURE_RECALC
capabilities will not be inherited through exec(2) unless the program
file has a capability set associated with it.
cap_get_proc returns a pointer to an allocated cap_t if successful, NULL
otherwise. The storage should be freed with a call to cap_free with the
returned pointer as an argument when it is no longer needed.
cap_set_proc and cap_set_proc_flags return 0 if successful, -1 otherwise.
ENOMEM allocation of the cap_t failed.
EINVAL cap is not valid
EPERM The caller attempted to set a capability flag of a
capability that was not permitted to the invoking
ENOMEM The function requires more memory than is allowed by the
hardware or system-imposed memory management constraints.
EINVAL flags is not valid
PPPPaaaaggggeeee 2222 [ Back ]