Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

sbuild::chroot_facet_source_clonable Class Reference

Chroot support for creation of source chroots. More...

#include <sbuild-chroot-facet-source-clonable.h>

Inheritance diagram for sbuild::chroot_facet_source_clonable:
Collaboration diagram for sbuild::chroot_facet_source_clonable:

List of all members.

Public Types

typedef std::shared_ptr
< chroot_facet_source_clonable
ptr
 A shared_ptr to a chroot facet object.
typedef std::shared_ptr< const
chroot_facet_source_clonable
const_ptr
 A shared_ptr to a const chroot facet object.

Public Member Functions

virtual ~chroot_facet_source_clonable ()
 The destructor.
virtual chroot_facet::ptr clone () const
 Copy the chroot facet.
virtual std::string const & get_name () const
 Get the name of the chroot facet.
virtual void clone_source_setup (chroot const &parent, chroot::ptr &clone) const
 Set the defaults in the cloned source chroot.
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.
virtual void set_source_clone (bool clone)
 Set if cloning a source chroot automatically is permitted.
virtual string_list const & get_source_users () const
 Get the users allowed to access the source chroot.
virtual void set_source_users (string_list const &users)
 Set the users allowed to access the source chroot.
virtual string_list const & get_source_groups () const
 Get the groups allowed to access the source chroot.
virtual void set_source_groups (string_list const &groups)
 Set the groups allowed to access the source chroot.
virtual string_list const & get_source_root_users () const
 Get the users allowed to access the source chroot as root.
virtual void set_source_root_users (string_list const &users)
 Set the users allowed to access the source chroot as root.
virtual string_list const & get_source_root_groups () const
 Get the groups allowed to access the source chroot as root.
virtual void set_source_root_groups (string_list const &groups)
 Set the groups allowed to access the source chroot as root.
virtual void setup_env (chroot const &chroot, environment &env) const
 Set environment.
virtual chroot::session_flags get_session_flags (chroot const &chroot) const
 Get the session flags of the chroot.
virtual void get_details (chroot const &chroot, format_detail &detail) const
 Get detailed information about the chroot for output.
virtual void get_keyfile (chroot const &chroot, keyfile &keyfile) const
 Copy the chroot properties into a keyfile.
virtual void set_keyfile (chroot &chroot, keyfile const &keyfile, string_list &used_keys)
 Set the chroot properties from a keyfile.

Static Public Member Functions

static ptr create ()
 Create a chroot facet.

Private Member Functions

 chroot_facet_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.

Detailed Description

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.


Member Function Documentation

chroot_facet::ptr chroot_facet_source_clonable::clone (  )  const [virtual]

Copy the chroot facet.

This is a virtual copy constructor.

Returns:
a shared_ptr to the new copy of the chroot facet.

Implements sbuild::chroot_facet.

References chroot_facet_source_clonable().

void chroot_facet_source_clonable::clone_source_setup ( chroot const &  parent,
chroot::ptr clone 
) const [virtual]

Set the defaults in the cloned source chroot.

Parameters:
parent the parent of the cloned chroot.
clone the chroot to set up.

References sbuild::_(), sbuild::chroot_facet_source::create(), get_source_groups(), get_source_root_groups(), get_source_root_users(), and get_source_users().

chroot_facet_source_clonable::ptr chroot_facet_source_clonable::create (  )  [static]
void chroot_facet_source_clonable::get_details ( chroot const &  chroot,
format_detail detail 
) const [virtual]

Get detailed information about the chroot for output.

Parameters:
chroot the chroot to use.
detail the details to output to.

Implements sbuild::chroot_facet.

References sbuild::_(), sbuild::format_detail::add(), get_source_groups(), get_source_root_groups(), get_source_root_users(), and get_source_users().

void chroot_facet_source_clonable::get_keyfile ( chroot const &  chroot,
keyfile keyfile 
) const [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.

Parameters:
chroot the chroot to use.
keyfile the keyfile to use.

Implements sbuild::chroot_facet.

References sbuild::chroot::get_name(), get_source_clone(), get_source_groups(), get_source_root_groups(), get_source_root_users(), get_source_users(), sbuild::basic_keyfile< K, P >::set_object_list_value(), and sbuild::basic_keyfile< K, P >::set_object_value().

std::string const & chroot_facet_source_clonable::get_name (  )  const [virtual]

Get the name of the chroot facet.

Returns:
the chroot facet name.

Implements sbuild::chroot_facet.

sbuild::chroot::session_flags chroot_facet_source_clonable::get_session_flags ( chroot const &  chroot  )  const [virtual]

Get the session flags of the chroot.

These determine how the Session controlling the chroot will operate.

Parameters:
chroot the chroot to use.
Returns:
the session flags.

Implements sbuild::chroot_facet.

References sbuild::chroot::get_facet().

bool chroot_facet_source_clonable::get_source_clone (  )  const [virtual]

Is cloning a source chroot automatically permitted? Note that this is merely a hint and does not prevent cloning.

Returns:
a list of clone.

References source_clone.

Referenced by get_keyfile().

Here is the caller graph for this function:

string_list const & chroot_facet_source_clonable::get_source_groups (  )  const [virtual]

Get the groups allowed to access the source chroot.

Returns:
a list of groups.

References source_groups.

Referenced by clone_source_setup(), get_details(), and get_keyfile().

Here is the caller graph for this function:

string_list const & chroot_facet_source_clonable::get_source_root_groups (  )  const [virtual]

Get the groups allowed to access the source chroot as root.

Members of these groups can switch to root without authenticating themselves.

Returns:
a list of groups.

References source_root_groups.

Referenced by clone_source_setup(), get_details(), and get_keyfile().

Here is the caller graph for this function:

string_list const & chroot_facet_source_clonable::get_source_root_users (  )  const [virtual]

Get the users allowed to access the source chroot as root.

Members of these users can switch to root without authenticating themselves.

Returns:
a list of users.

References source_root_users.

Referenced by clone_source_setup(), get_details(), and get_keyfile().

Here is the caller graph for this function:

string_list const & chroot_facet_source_clonable::get_source_users (  )  const [virtual]

Get the users allowed to access the source chroot.

Returns:
a list of users.

References source_users.

Referenced by clone_source_setup(), get_details(), and get_keyfile().

Here is the caller graph for this function:

void chroot_facet_source_clonable::set_keyfile ( chroot chroot,
keyfile const &  keyfile,
string_list used_keys 
) [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.

Parameters:
chroot the chroot to use.
keyfile the keyfile to get the properties from.
used_keys a list of the keys used will be set.

Implements sbuild::chroot_facet.

References sbuild::chroot::get_name(), sbuild::basic_keyfile< K, P >::get_object_list_value(), sbuild::basic_keyfile< K, P >::get_object_value(), set_source_clone(), set_source_groups(), set_source_root_groups(), set_source_root_users(), and set_source_users().

void chroot_facet_source_clonable::set_source_clone ( bool  clone  )  [virtual]

Set if cloning a source chroot automatically is permitted.

Note that this is merely a hint and does not prevent cloning.

Parameters:
clone true to automatically clone, otherwise false.

Referenced by set_keyfile().

Here is the caller graph for this function:

void chroot_facet_source_clonable::set_source_groups ( string_list const &  groups  )  [virtual]

Set the groups allowed to access the source chroot.

Parameters:
groups a list of groups.

Referenced by set_keyfile().

Here is the caller graph for this function:

void chroot_facet_source_clonable::set_source_root_groups ( string_list const &  groups  )  [virtual]

Set the groups allowed to access the source chroot as root.

Members of these groups can switch to root without authenticating themselves.

Parameters:
groups a list of groups.

References source_root_groups.

Referenced by set_keyfile().

Here is the caller graph for this function:

void chroot_facet_source_clonable::set_source_root_users ( string_list const &  users  )  [virtual]

Set the users allowed to access the source chroot as root.

Members of these users can switch to root without authenticating themselves.

Parameters:
users a list of users.

References source_root_users.

Referenced by set_keyfile().

Here is the caller graph for this function:

void chroot_facet_source_clonable::set_source_users ( string_list const &  users  )  [virtual]

Set the users allowed to access the source chroot.

Parameters:
users a list of users.

Referenced by set_keyfile().

Here is the caller graph for this function:

void chroot_facet_source_clonable::setup_env ( chroot const &  chroot,
environment env 
) const [virtual]

Set environment.

Set the environment that the setup scripts will see during execution.

Parameters:
chroot the chroot to use.
env the environment to set.

Implements sbuild::chroot_facet.


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