dchroot::session_base Class Reference

Basic session handler for dchroot sessions. More...

#include <dchroot-session-base.h>

Inheritance diagram for dchroot::session_base:

Inheritance graph
[legend]
Collaboration diagram for dchroot::session_base:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 session_base (std::string const &service, config_ptr &config, operation operation, sbuild::string_list const &chroots, bool compat)
 The constructor.
virtual ~session_base ()
 The destructor.
bool get_compat () const
 Get the dchroot compatibility state.
void set_compat (bool state)
 Set the dchroot compatibility state.

Protected Member Functions

virtual void run_impl ()
 Run a session.
virtual sbuild::string_list get_command_directories () const
 Get a list of directories to change to when running a command Multiple directories are used as fallbacks.

Private Attributes

bool compat
 dchroot compatibility enabled?

Detailed Description

Basic session handler for dchroot sessions.

This class provides common session functionality for dchroot and dchroot-dsa, such as providing a schroot compatibility mode. It also prevents user switching when running sessions, which is forbidden.


Constructor & Destructor Documentation

session_base::session_base ( std::string const &  service,
config_ptr config,
operation  operation,
sbuild::string_list const &  chroots,
bool  compat 
)

The constructor.

Parameters:
service the PAM service name.
config a shared_ptr to the chroot configuration.
operation the session operation to perform.
chroots the chroots to act upon.
compat true to enable full dchroot compatibility, or false to enable schroot compatiblity (permissions checks).

session_base::~session_base (  )  [virtual]

The destructor.


Member Function Documentation

sbuild::string_list session_base::get_command_directories (  )  const [protected, virtual]

Get a list of directories to change to when running a command Multiple directories are used as fallbacks.

Returns:
a list of directories

Reimplemented from sbuild::session.

bool session_base::get_compat (  )  const

Get the dchroot compatibility state.

Returns:
the state.

void session_base::run_impl (  )  [protected, virtual]

Run a session.

If a command has been specified, this will be run in each of the specified chroots. If no command has been specified, a login shell will run in the specified chroot.

An error will be thrown on failure.

Reimplemented from sbuild::session.

void session_base::set_compat ( bool  state  ) 

Set the dchroot compatibility state.

Parameters:
state the dchroot compatibility state.


Member Data Documentation

bool dchroot::session_base::compat [private]

dchroot compatibility enabled?


The documentation for this class was generated from the following files:
Generated on Mon Sep 11 23:17:46 2006 for schroot by  doxygen 1.4.7