sbuild  1.6.10
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
sbuild::chroot_facet_session_clonable Class Reference

Chroot support for creation of sessions. More...

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

+ Inheritance diagram for sbuild::chroot_facet_session_clonable:
+ Collaboration diagram for sbuild::chroot_facet_session_clonable:

Public Types

typedef std::shared_ptr< chroot_facet_session_clonableptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const chroot_facet_session_clonableconst_ptr
 A shared_ptr to a const chroot facet object.
 
- Public Types inherited from sbuild::chroot_facet
typedef std::shared_ptr< chroot_facetptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const chroot_facetconst_ptr
 A shared_ptr to a const chroot facet object.
 

Public Member Functions

virtual ~chroot_facet_session_clonable ()
 The destructor.
 
virtual chroot_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 void clone_session_setup (chroot const &parent, chroot::ptr &clone, std::string const &session_id, std::string const &alias, std::string const &user, bool root) const
 Set the defaults in the cloned session chroot. More...
 
virtual void setup_env (chroot const &chroot, environment &env) const
 Set environment. More...
 
virtual chroot::session_flags get_session_flags (chroot const &chroot) const
 Get the session flags of the chroot. More...
 
virtual void get_details (chroot const &chroot, format_detail &detail) const
 Get detailed information about the chroot for output. More...
 
virtual void get_keyfile (chroot const &chroot, keyfile &keyfile) const
 Copy the chroot properties into a keyfile. More...
 
virtual void set_keyfile (chroot &chroot, keyfile const &keyfile, string_list &used_keys)
 Set the chroot properties from a keyfile. More...
 
- Public Member Functions inherited from sbuild::chroot_facet
virtual ~chroot_facet ()
 The destructor.
 

Static Public Member Functions

static ptr create ()
 Create a chroot facet. More...
 

Private Member Functions

 chroot_facet_session_clonable ()
 The constructor.
 

Additional Inherited Members

- Protected Member Functions inherited from sbuild::chroot_facet
 chroot_facet ()
 The constructor.
 
void set_chroot (chroot &chroot)
 Set containing chroot. More...
 
- Protected Attributes inherited from sbuild::chroot_facet
chrootowner
 Chroot owning this facet.
 

Detailed Description

Chroot support for creation of sessions.

A chroot may offer a "session" facet to signal restorable or parallel chroot environment usage. This facet allows the chroot to support session creation.

Member Function Documentation

chroot_facet::ptr chroot_facet_session_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_session_clonable().

void chroot_facet_session_clonable::clone_session_setup ( chroot const &  parent,
chroot::ptr clone,
std::string const &  session_id,
std::string const &  alias,
std::string const &  user,
bool  root 
) const
virtual

Set the defaults in the cloned session chroot.

Parameters
parentthe parent of the cloned chroot.
clonethe chroot to set up.
session_idthe identifier for the new session.
userthe user creating the session.
rootwhether or not the user is switching to root.

References sbuild::_(), sbuild::chroot_facet_session::create(), sbuild::DEBUG_INFO, sbuild::DEBUG_NOTICE, sbuild::dirname(), sbuild::chroot::get_facet(), sbuild::log_debug(), and sbuild::chroot_facet::owner.

chroot_facet_session_clonable::ptr chroot_facet_session_clonable::create ( )
static

Create a chroot facet.

Returns
a shared_ptr to the new chroot facet.

References chroot_facet_session_clonable().

Referenced by sbuild::chroot::chroot(), and sbuild::chroot_custom::set_session_cloneable().

+ Here is the caller graph for this function:

void chroot_facet_session_clonable::get_details ( chroot const &  chroot,
format_detail detail 
) const
virtual

Get detailed information about the chroot for output.

Parameters
chrootthe chroot to use.
detailthe details to output to.

Implements sbuild::chroot_facet.

void chroot_facet_session_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
chrootthe chroot to use.
keyfilethe keyfile to use.

Implements sbuild::chroot_facet.

std::string const & chroot_facet_session_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_session_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
chrootthe chroot to use.
Returns
the session flags.

Implements sbuild::chroot_facet.

References sbuild::chroot::SESSION_CREATE.

void chroot_facet_session_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
chrootthe chroot to use.
keyfilethe keyfile to get the properties from.
used_keysa list of the keys used will be set.

Implements sbuild::chroot_facet.

void chroot_facet_session_clonable::setup_env ( chroot const &  chroot,
environment env 
) const
virtual

Set environment.

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

Parameters
chrootthe chroot to use.
envthe environment to set.

Implements sbuild::chroot_facet.


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