sbuild::chroot_source Class Reference

A chroot may offer a "source" chroot in addition to its normal "session" copy, to allow for maintenence of the source data. More...

#include <sbuild-chroot-source.h>

Inheritance diagram for sbuild::chroot_source:

Inheritance graph
[legend]
Collaboration diagram for sbuild::chroot_source:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~chroot_source ()
 The destructor.
virtual chroot::ptr clone_source () const=0
 Create a source chroot.
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.
void setup_env (environment &env)
 Set environment.

Protected Member Functions

 chroot_source ()
 The constructor.
void clone_source_setup (chroot::ptr &clone) const
 Set the defaults in the cloned source chroot.
virtual void get_details (format_detail &detail) const
 Get detailed information about the chroot for output.
void get_keyfile (keyfile &keyfile) const
 Copy the chroot properties into a keyfile.
void set_keyfile (keyfile const &keyfile)
 Set the chroot properties from a keyfile.

Private Attributes

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.

Friends

class chroot

Detailed Description

A chroot may offer a "source" chroot in addition to its normal "session" copy, to allow for maintenence of the source data.

This interface may be implemented by any chroot wishing to provide such functionality.

While this is effectively an interface, in practice this derives from sbuild::chroot, to allow setting and getting of data from a keyfile, including storing the keyfile options.

Chroot types implementing chroot_source should, at a minimum, implement clone_source(). This should create and return a source chroot, and must call clone_source_setup() to set up the source chroot.

Definition at line 43 of file sbuild-chroot-source.h.


Constructor & Destructor Documentation

chroot_source::chroot_source (  )  [protected]

The constructor.

Definition at line 33 of file sbuild-chroot-source.cc.

chroot_source::~chroot_source (  )  [virtual]

The destructor.

Definition at line 38 of file sbuild-chroot-source.cc.


Member Function Documentation

virtual chroot::ptr sbuild::chroot_source::clone_source (  )  const [pure virtual]

Create a source chroot.

Returns:
a source chroot.

Implemented in sbuild::chroot_file, and sbuild::chroot_lvm_snapshot.

Referenced by sbuild::chroot_config::load_keyfile().

Here is the caller graph for this function:

void chroot_source::clone_source_setup ( chroot::ptr clone  )  const [protected]

Set the defaults in the cloned source chroot.

Parameters:
clone the chroot to set up.

Definition at line 43 of file sbuild-chroot-source.cc.

References _, and sbuild::chroot::aliases.

Referenced by sbuild::chroot_lvm_snapshot::clone_source(), and sbuild::chroot_file::clone_source().

Here is the caller graph for this function:

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

Get the users allowed to access the source chroot.

Returns:
a list of users.

Definition at line 63 of file sbuild-chroot-source.cc.

References source_users.

Referenced by get_details(), and get_keyfile().

Here is the caller graph for this function:

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

Set the users allowed to access the source chroot.

Parameters:
users a list of users.

Definition at line 69 of file sbuild-chroot-source.cc.

Referenced by set_keyfile().

Here is the caller graph for this function:

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

Get the groups allowed to access the source chroot.

Returns:
a list of groups.

Definition at line 75 of file sbuild-chroot-source.cc.

References source_groups.

Referenced by get_details(), and get_keyfile().

Here is the caller graph for this function:

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

Set the groups allowed to access the source chroot.

Parameters:
groups a list of groups.

Definition at line 81 of file sbuild-chroot-source.cc.

Referenced by set_keyfile().

Here is the caller graph for this function:

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

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

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

Returns:
a list of users.

Definition at line 87 of file sbuild-chroot-source.cc.

References source_root_users.

Referenced by get_details(), and get_keyfile().

Here is the caller graph for this function:

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

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

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

Parameters:
users a list of users.

Definition at line 93 of file sbuild-chroot-source.cc.

References source_root_users.

Referenced by set_keyfile().

Here is the caller graph for this function:

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

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

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

Returns:
a list of groups.

Definition at line 99 of file sbuild-chroot-source.cc.

References source_root_groups.

Referenced by get_details(), and get_keyfile().

Here is the caller graph for this function:

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

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

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

Parameters:
groups a list of groups.

Definition at line 105 of file sbuild-chroot-source.cc.

References source_root_groups.

Referenced by set_keyfile().

Here is the caller graph for this function:

void chroot_source::setup_env ( environment env  )  [virtual]

Set environment.

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

Parameters:
env the environment to set.

Reimplemented from sbuild::chroot.

Reimplemented in sbuild::chroot_file, and sbuild::chroot_lvm_snapshot.

Definition at line 111 of file sbuild-chroot-source.cc.

Referenced by sbuild::chroot_lvm_snapshot::setup_env(), and sbuild::chroot_file::setup_env().

Here is the caller graph for this function:

void chroot_source::get_details ( format_detail detail  )  const [protected, virtual]

Get detailed information about the chroot for output.

Parameters:
detail the details to output to.

Reimplemented from sbuild::chroot.

Reimplemented in sbuild::chroot_file, and sbuild::chroot_lvm_snapshot.

Definition at line 116 of file sbuild-chroot-source.cc.

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

Referenced by sbuild::chroot_lvm_snapshot::get_details(), and sbuild::chroot_file::get_details().

Here is the call graph for this function:

Here is the caller graph for this function:

void chroot_source::get_keyfile ( keyfile keyfile  )  const [protected, 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:
keyfile the keyfile to use.

Reimplemented from sbuild::chroot.

Reimplemented in sbuild::chroot_file, and sbuild::chroot_lvm_snapshot.

Definition at line 126 of file sbuild-chroot-source.cc.

References sbuild::chroot::get_name(), get_source_groups(), get_source_root_groups(), get_source_root_users(), get_source_users(), and sbuild::keyfile::set_object_list_value().

Referenced by sbuild::chroot_lvm_snapshot::get_keyfile(), and sbuild::chroot_file::get_keyfile().

Here is the call graph for this function:

Here is the caller graph for this function:

void chroot_source::set_keyfile ( keyfile const &  keyfile  )  [protected, 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:
keyfile the keyfile to get the properties from.

Reimplemented from sbuild::chroot.

Reimplemented in sbuild::chroot_file, and sbuild::chroot_lvm_snapshot.

Definition at line 142 of file sbuild-chroot-source.cc.

References sbuild::chroot::get_name(), sbuild::keyfile::get_object_list_value(), sbuild::keyfile::PRIORITY_OPTIONAL, set_source_groups(), set_source_root_groups(), set_source_root_users(), and set_source_users().

Referenced by sbuild::chroot_lvm_snapshot::set_keyfile(), and sbuild::chroot_file::set_keyfile().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class chroot [friend]

Reimplemented in sbuild::chroot_file, and sbuild::chroot_lvm_snapshot.

Definition at line 49 of file sbuild-chroot-source.h.


Member Data Documentation

string_list sbuild::chroot_source::source_users [private]

Users allowed to access the source chroot.

Definition at line 160 of file sbuild-chroot-source.h.

Referenced by get_source_users().

string_list sbuild::chroot_source::source_groups [private]

Groups allowed to access the source chroot.

Definition at line 162 of file sbuild-chroot-source.h.

Referenced by get_source_groups().

string_list sbuild::chroot_source::source_root_users [private]

Users allowed to access the source chroot as root.

Definition at line 164 of file sbuild-chroot-source.h.

Referenced by get_source_root_users(), and set_source_root_users().

string_list sbuild::chroot_source::source_root_groups [private]

Groups allowed to access the source chroot as root.

Definition at line 166 of file sbuild-chroot-source.h.

Referenced by get_source_root_groups(), and set_source_root_groups().


The documentation for this class was generated from the following files:
Generated on Sat Jan 27 16:13:40 2007 for schroot by  doxygen 1.5.1