|
Crinit -- Configurable Rootfs Init
|
Implementation of functions related to process capability handling. More...
#include "capabilities.h"#include <linux/securebits.h>#include <sys/capability.h>#include <sys/prctl.h>#include <sys/syscall.h>#include <unistd.h>#include "common.h"#include "confconv.h"#include "logio.h"
Functions | |
| static int | crinitProcCapGet (cap_user_data_t out, pid_t pid) |
| int | crinitCapConvertToBitmask (uint64_t *bitmask, const char *capabilities) |
| int | crinitCapGetInheritable (pid_t pid, uint64_t *result) |
| bool | crinitCapIsCapsetEffective (cap_value_t cap, pid_t pid) |
| int | crinitCapSetAmbient (uint64_t capMask) |
| static int | crinitSetCapStateInheritable (uint64_t capMask, cap_t capState) |
| int | crinitCapSetInheritable (uint64_t capMask) |
| int | crinitCapRetainPermitted () |
Implementation of functions related to process capability handling.
| int crinitCapConvertToBitmask | ( | uint64_t * | bitmask, |
| const char * | capabilities | ||
| ) |
Convert capability names to integral value and set it in bitmask.
| bitmask | Bitmask to maintain capability settings. |
| capabilities | Array of capability names |
| int crinitCapGetInheritable | ( | pid_t | pid, |
| uint64_t * | result | ||
| ) |
Get a process' inheritable capability set
| pid | The ID of the process whose capabilities are retrieved. |
| result | Pointer to result bitmask that holds the inheritable capability set. |
| bool crinitCapIsCapsetEffective | ( | cap_value_t | cap, |
| pid_t | pid | ||
| ) |
Test if a capability is set in a process' effective capability set.
| cap | The capability to test. |
| pid | The ID of the process whose capabilities are checked. |
| int crinitCapRetainPermitted | ( | ) |
Configure a process to retain its permitted set of capabilities.
| int crinitCapSetAmbient | ( | uint64_t | capMask | ) |
Set a process' ambient capability set
| capMask | The capability set encoded as a bitmask |
| int crinitCapSetInheritable | ( | uint64_t | capMask | ) |
Set a process' inheritable capability set
| capMask | The capability set encoded as a bitmask |
|
static |
Gets capabilities of process specified by PID.
| out | Return pointer for capabilities. Note, that the Linux API defines cap_user_data_t as a pointer to struct __user_cap_header_struct. The given pointer needs to point to at least two elements. |
| pid | PID of the process from which to get the capabilities. |
|
static |