Apache Mesos
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
mesos::internal::capabilities::Capabilities Class Reference

Provides wrapper for the linux process capabilities interface. More...

#include <capabilities.hpp>

Public Member Functions

Try< ProcessCapabilitiesget () const
 Gets capability set for the calling process. More...
 
Try< Nothingset (const ProcessCapabilities &processCapabilities)
 Sets capabilities for the calling process. More...
 
Try< NothingsetKeepCaps ()
 Process control interface to enforce keeping the parent process's capabilities after a change in uid/gid. More...
 
std::set< CapabilitygetAllSupportedCapabilities ()
 Get all capabilities supported by the system. More...
 

Static Public Member Functions

static Try< Capabilitiescreate ()
 Factory method to create Capabilities object. More...
 

Public Attributes

const bool ambientCapabilitiesSupported
 Whether ambient capabilities are supported on this host. More...
 

Detailed Description

Provides wrapper for the linux process capabilities interface.

Note: This is a class instead of an interface because it has state associated with it.

TODO(jojy): Currently we only support linux capabilities. Consider refactoring the interface so that we can support a generic interface which can be used for other OSes(BSD, Windows etc).

Member Function Documentation

static Try<Capabilities> mesos::internal::capabilities::Capabilities::create ( )
static

Factory method to create Capabilities object.

Returns
Capabilities on success; Error on failure. Failure conditions could be:
  • Error getting system information (e.g, version).
  • Unsupported linux kernel capabilities version.
  • Maximum capability supported by kernel exceeds the ones defined in the enum Capabilities.
Try<ProcessCapabilities> mesos::internal::capabilities::Capabilities::get ( ) const

Gets capability set for the calling process.

Returns
ProcessCapabilities on success. Error on failure.
std::set<Capability> mesos::internal::capabilities::Capabilities::getAllSupportedCapabilities ( )

Get all capabilities supported by the system.

Returns
the set of supported capabilities.
Try<Nothing> mesos::internal::capabilities::Capabilities::set ( const ProcessCapabilities processCapabilities)

Sets capabilities for the calling process.

Parameters
<tt>ProcessCapabilities</tt>to be set for the process.
Returns
Nothing on success. Error on failure.
Try<Nothing> mesos::internal::capabilities::Capabilities::setKeepCaps ( )

Process control interface to enforce keeping the parent process's capabilities after a change in uid/gid.

Returns
Nothing on success. Error on failure.

Member Data Documentation

const bool mesos::internal::capabilities::Capabilities::ambientCapabilitiesSupported

Whether ambient capabilities are supported on this host.

If ambient capabilities are supported, the AMBIENT set will be populated when getting the process capabilities and applied when setting them. Otherwise the AMBIENT set will be ignored.


The documentation for this class was generated from the following file: