sbuild
1.7.1
|
Chroot support for creation of source chroots. More...
#include <source-clonable.h>
Public Types | |
typedef std::shared_ptr < source_clonable > | ptr |
A shared_ptr to a chroot facet object. | |
typedef std::shared_ptr< const source_clonable > | const_ptr |
A shared_ptr to a const chroot facet object. | |
![]() | |
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 | ~source_clonable () |
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... | |
virtual chroot::ptr | clone_source () const |
Clone a source chroot. More... | |
virtual bool | get_source_clone () const |
Is cloning a source chroot automatically permitted? Note that this is merely a hint and does not prevent cloning. More... | |
virtual void | set_source_clone (bool clone) |
Set if cloning a source chroot automatically is permitted. More... | |
virtual string_list const & | get_source_users () const |
Get the users allowed to access the source chroot. More... | |
virtual void | set_source_users (const string_list &users) |
Set the users allowed to access the source chroot. More... | |
virtual string_list const & | get_source_groups () const |
Get the groups allowed to access the source chroot. More... | |
virtual void | set_source_groups (const string_list &groups) |
Set the groups allowed to access the source chroot. More... | |
virtual string_list const & | get_source_root_users () const |
Get the users allowed to access the source chroot as root. More... | |
virtual void | set_source_root_users (const string_list &users) |
Set the users allowed to access the source chroot as root. More... | |
virtual string_list const & | get_source_root_groups () const |
Get the groups allowed to access the source chroot as root. More... | |
virtual void | set_source_root_groups (const string_list &groups) |
Set the groups allowed to access the source chroot as root. More... | |
virtual session_flags | get_session_flags () const |
Get the session flags of the chroot. 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 void | setup_env (environment &env) const |
Set environment. More... | |
Static Public Member Functions | |
static ptr | create () |
Create a chroot facet. More... | |
Private Member Functions | |
source_clonable () | |
The constructor. | |
Private Attributes | |
bool | source_clone |
Is source chroot cloning permitted? | |
string_list | source_users |
Users allowed to access the source chroot. | |
string_list | source_groups |
Groups allowed to access the source chroot. | |
string_list | source_root_users |
Users allowed to access the source chroot as root. | |
string_list | source_root_groups |
Groups allowed to access the source chroot as root. | |
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 creation of source chroots.
A chroot may offer a "source" chroot in addition to its typical session clone, to allow for maintenence of the source data. This facet can be used by any chroot wishing to provide such functionality.
|
virtual |
Copy the chroot facet.
This is a virtual copy constructor.
Implements sbuild::chroot::facet::facet.
References source_clonable().
Referenced by clone_source().
|
virtual |
Clone a source chroot.
References sbuild::_(), sbuild::chroot::facet::source_setup::chroot_source_setup(), clone(), sbuild::chroot::chroot::clone(), sbuild::chroot::facet::source::create(), sbuild::chroot::facet::facet::facet(), get_source_groups(), get_source_root_groups(), get_source_root_users(), get_source_users(), and sbuild::chroot::facet::facet::owner.
|
static |
Create a chroot facet.
References source_clonable().
Referenced by sbuild::chroot::facet::lvm_snapshot::set_chroot(), sbuild::chroot::facet::file::set_chroot(), sbuild::chroot::facet::btrfs_snapshot::set_chroot(), sbuild::chroot::facet::custom::set_source_cloneable(), and sbuild::chroot::facet::fsunion::set_union_type().
|
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_source_groups(), get_source_root_groups(), get_source_root_users(), and get_source_users().
|
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_source_clone(), get_source_groups(), get_source_root_groups(), get_source_root_users(), get_source_users(), sbuild::chroot::facet::facet::owner, sbuild::keyfile::set_object_list_value(), and sbuild::keyfile::set_object_value().
|
virtual |
Get the name of the chroot facet.
Implements sbuild::chroot::facet::facet.
|
virtual |
Get the session flags of the chroot.
These determine how the Session controlling the chroot will operate.
chroot | the chroot to use. |
Reimplemented from sbuild::chroot::facet::facet.
References sbuild::chroot::chroot::get_facet(), sbuild::chroot::facet::facet::owner, sbuild::chroot::facet::facet::SESSION_CLONE, and sbuild::chroot::facet::facet::SESSION_NOFLAGS.
|
virtual |
Is cloning a source chroot automatically permitted? Note that this is merely a hint and does not prevent cloning.
References source_clone.
Referenced by get_keyfile().
|
virtual |
Get the groups allowed to access the source chroot.
References source_groups.
Referenced by clone_source(), get_details(), and get_keyfile().
|
virtual |
Get the groups allowed to access the source chroot as root.
Members of these groups can switch to root without authenticating themselves.
References source_root_groups.
Referenced by clone_source(), get_details(), and get_keyfile().
|
virtual |
Get the users allowed to access the source chroot as root.
Members of these users can switch to root without authenticating themselves.
References source_root_users.
Referenced by clone_source(), get_details(), and get_keyfile().
|
virtual |
Get the users allowed to access the source chroot.
References source_users.
Referenced by clone_source(), get_details(), and get_keyfile().
|
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_list_value(), sbuild::keyfile::get_object_value(), sbuild::chroot::facet::facet::owner, sbuild::keyfile::PRIORITY_OPTIONAL, set_source_clone(), set_source_groups(), set_source_root_groups(), set_source_root_users(), and set_source_users().
|
virtual |
Set if cloning a source chroot automatically is permitted.
Note that this is merely a hint and does not prevent cloning.
clone | true to automatically clone, otherwise false. |
References source_clone.
Referenced by set_keyfile().
|
virtual |
Set the groups allowed to access the source chroot.
groups | a list of groups. |
References source_groups.
Referenced by set_keyfile().
|
virtual |
Set the groups allowed to access the source chroot as root.
Members of these groups can switch to root without authenticating themselves.
groups | a list of groups. |
References source_root_groups.
Referenced by set_keyfile().
|
virtual |
Set the users allowed to access the source chroot as root.
Members of these users can switch to root without authenticating themselves.
users | a list of users. |
References source_root_users.
Referenced by set_keyfile().
|
virtual |
Set the users allowed to access the source chroot.
users | a list of users. |
References source_users.
Referenced by set_keyfile().