sbuild
1.7.1
|
Chroot support for unsharing process execution context. More...
#include <unshare.h>
Public Types | |
enum | error_code { UNSHARE } |
Error codes. More... | |
typedef std::shared_ptr< unshare > | ptr |
A shared_ptr to a chroot facet object. | |
typedef std::shared_ptr< const unshare > | const_ptr |
A shared_ptr to a const chroot facet object. | |
typedef custom_error< error_code > | error |
Exception type. | |
![]() | |
enum | session_flags { SESSION_NOFLAGS = 0, SESSION_CREATE = 1 << 0, SESSION_CLONE = 1 << 1, SESSION_PURGE = 1 << 2 } |
Chroot session properties. More... | |
typedef std::shared_ptr< facet > | ptr |
A shared_ptr to a chroot facet object. | |
typedef std::shared_ptr< const facet > | const_ptr |
A shared_ptr to a const chroot facet object. | |
Public Member Functions | |
virtual | ~unshare () |
The destructor. | |
virtual facet::ptr | clone () const |
Copy the chroot facet. More... | |
virtual std::string const & | get_name () const |
Get the name of the chroot facet. More... | |
bool | get_unshare_net () const |
Is networking unshared? More... | |
void | set_unshare_net (bool unshare) |
Set network unsharing. More... | |
bool | get_unshare_sysvipc () const |
Is System V IPC unshared? More... | |
void | set_unshare_sysvipc (bool unshare) |
Set System V IPC unsharing. More... | |
bool | get_unshare_sysvsem () const |
Is System V SEM unshared? More... | |
void | set_unshare_sysvsem (bool unshare) |
Set System V SEM unsharing. More... | |
bool | get_unshare_uts () const |
Is UTS namespace unshared? More... | |
void | set_unshare_uts (bool unshare) |
Set System UTS namespace unsharing. More... | |
void | do_unshare () const |
Unshare process execution context. | |
virtual void | setup_env (environment &env) const |
Set environment. More... | |
virtual void | get_details (format_detail &detail) const |
Get detailed information about the chroot for output. More... | |
virtual void | get_used_keys (string_list &used_keys) const |
Get a list of the keys used during keyfile parsing. More... | |
virtual void | get_keyfile (keyfile &keyfile) const |
Copy the chroot properties into a keyfile. More... | |
virtual void | set_keyfile (const keyfile &keyfile) |
Set the chroot properties from a keyfile. More... | |
![]() | |
virtual | ~facet () |
The destructor. | |
virtual session_flags | get_session_flags () const |
Get the session flags of the chroot. More... | |
Static Public Member Functions | |
static ptr | create () |
Create a chroot facet. More... | |
Private Member Functions | |
unshare () | |
The constructor. | |
Private Attributes | |
bool | unshare_net |
Unshare networking. | |
bool | unshare_sysvipc |
Unshare System V IPC. | |
bool | unshare_sysvsem |
Unshare System V SEM. | |
bool | unshare_uts |
Unshare System V SEM. | |
Additional Inherited Members | |
![]() | |
facet () | |
The constructor. | |
virtual void | set_chroot (chroot &chroot, bool copy=false) |
Set containing chroot. More... | |
![]() | |
chroot * | owner |
Chroot owning this facet. | |
Chroot support for unsharing process execution context.
|
virtual |
Copy the chroot facet.
This is a virtual copy constructor.
Implements sbuild::chroot::facet::facet.
References unshare().
|
static |
|
virtual |
Get detailed information about the chroot for output.
detail | the details to output to. |
Reimplemented from sbuild::chroot::facet::facet.
References sbuild::_(), sbuild::format_detail::add(), get_unshare_net(), get_unshare_sysvipc(), get_unshare_sysvsem(), and get_unshare_uts().
|
virtual |
Copy the chroot properties into a keyfile.
The keyfile group with the name of the chroot will be set; if it already exists, it will be removed before setting it.
keyfile | the keyfile to use. |
Reimplemented from sbuild::chroot::facet::facet.
References sbuild::chroot::chroot::get_name(), get_unshare_net(), get_unshare_sysvipc(), get_unshare_sysvsem(), get_unshare_uts(), sbuild::chroot::facet::facet::owner, and sbuild::keyfile::set_object_value().
|
virtual |
Get the name of the chroot facet.
Implements sbuild::chroot::facet::facet.
bool sbuild::chroot::facet::unshare::get_unshare_net | ( | ) | const |
Is networking unshared?
References unshare_net.
Referenced by get_details(), get_keyfile(), and setup_env().
bool sbuild::chroot::facet::unshare::get_unshare_sysvipc | ( | ) | const |
Is System V IPC unshared?
References unshare_sysvipc.
Referenced by get_details(), get_keyfile(), and setup_env().
bool sbuild::chroot::facet::unshare::get_unshare_sysvsem | ( | ) | const |
Is System V SEM unshared?
References unshare_sysvsem.
Referenced by get_details(), get_keyfile(), and setup_env().
bool sbuild::chroot::facet::unshare::get_unshare_uts | ( | ) | const |
Is UTS namespace unshared?
References unshare_uts.
Referenced by get_details(), get_keyfile(), and setup_env().
|
virtual |
Get a list of the keys used during keyfile parsing.
Reimplemented from sbuild::chroot::facet::facet.
|
virtual |
Set the chroot properties from a keyfile.
The chroot name must have previously been set, so that the correct keyfile group may be determined.
keyfile | the keyfile to get the properties from. |
Reimplemented from sbuild::chroot::facet::facet.
References sbuild::chroot::chroot::get_name(), sbuild::keyfile::get_object_value(), sbuild::chroot::facet::facet::owner, sbuild::keyfile::PRIORITY_OPTIONAL, set_unshare_net(), set_unshare_sysvipc(), set_unshare_sysvsem(), and set_unshare_uts().
void sbuild::chroot::facet::unshare::set_unshare_net | ( | bool | unshare) |
Set network unsharing.
unshare | unshare? |
References unshare_net.
Referenced by set_keyfile().
void sbuild::chroot::facet::unshare::set_unshare_sysvipc | ( | bool | unshare) |
Set System V IPC unsharing.
unshare | unshare? |
References unshare_sysvipc.
Referenced by set_keyfile().
void sbuild::chroot::facet::unshare::set_unshare_sysvsem | ( | bool | unshare) |
Set System V SEM unsharing.
unshare | unshare? |
References unshare_sysvsem.
Referenced by set_keyfile().
void sbuild::chroot::facet::unshare::set_unshare_uts | ( | bool | unshare) |
Set System UTS namespace unsharing.
unshare | unshare? |
References unshare_uts.
Referenced by set_keyfile().
|
virtual |
Set environment.
Set the environment that the setup scripts will see during execution.
env | the environment to set. |
Reimplemented from sbuild::chroot::facet::facet.
References sbuild::environment::add(), get_unshare_net(), get_unshare_sysvipc(), get_unshare_sysvsem(), and get_unshare_uts().