Logo Search packages:      
Sourcecode: schroot version File versions  Download package

sbuild::session Class Reference

#include <sbuild-session.h>

Inheritance diagram for sbuild::session:

sbuild::auth dchroot::session

List of all members.


Detailed Description

Session handler.

This class provides the session handling for schroot. It derives from auth, which performs all the necessary PAM actions, specialising it by overriding its virtual functions. This allows more sophisticated handling of user authorisation (groups and root-groups membership in the configuration file) and session management (setting up the session, entering the chroot and running the requested command or shell).

Definition at line 49 of file sbuild-session.h.


Public Types

typedef std::tr1::shared_ptr
< chroot_config
config_ptr
 A shared_ptr to a chroot_config object.
typedef std::tr1::shared_ptr
< auth_conv
conv_ptr
 A shared_ptr to an auth_conv object.
typedef runtime_error_custom
< session
error
 Exception type.
enum  operation {
  OPERATION_AUTOMATIC, OPERATION_BEGIN, OPERATION_RECOVER, OPERATION_END,
  OPERATION_RUN
}
 Session operations. More...
typedef std::tr1::shared_ptr
< session
ptr
 A shared_ptr to a session object.
enum  status { STATUS_NONE, STATUS_USER, STATUS_FAIL }
 Authentication status. More...
enum  verbosity { VERBOSITY_QUIET, VERBOSITY_NORMAL, VERBOSITY_VERBOSE }
 Message verbosity. More...

Public Member Functions

void account ()
void authenticate ()
status change_auth (status oldauth, status newauth) const
void close_session ()
void cred_delete ()
void cred_establish ()
virtual sbuild::auth::status get_auth_status () const
int get_child_status () const
string_list const & get_chroots () const
string_list const & get_command () const
config_ptrget_config ()
conv_ptrget_conv ()
environment const & get_environment () const
bool get_force () const
gid_t get_gid () const
std::string const & get_home () const
operation get_operation () const
environment get_pam_environment () const
uid_t get_ruid () const
std::string const & get_ruser () const
std::string const & get_service () const
std::string const & get_session_id () const
std::string const & get_shell () const
uid_t get_uid () const
std::string const & get_user () const
verbosity get_verbosity () const
void open_session ()
void run ()
virtual void run_impl ()
 session (std::string const &service, config_ptr &config, operation operation, string_list const &chroots)
void set_chroots (string_list const &chroots)
void set_command (string_list const &command)
void set_config (config_ptr &config)
void set_conv (conv_ptr &conv)
void set_environment (environment const &environment)
void set_environment (char **environment)
void set_force (bool force)
void set_operation (operation operation)
void set_session_id (std::string const &session_id)
void set_user (std::string const &user)
void set_verbosity (verbosity verbosity)
void setupenv ()
void start ()
void stop ()
virtual ~session ()
 The destructor.

Protected Attributes

pam_handle_t * pam
 The PAM handle.

Private Member Functions

void clear_sighup_handler ()
int exec (std::string const &file, string_list const &command, environment const &env)
void run_child (chroot::ptr &session_chroot)
void run_chroot (chroot::ptr &session_chroot)
void set_sighup_handler ()
void setup_chroot (chroot::ptr &session_chroot, chroot::setup_type setup_type)
void wait_for_child (int pid, int &child_status)

Private Attributes

int child_status
 The child exit status.
int chroot_status
 The current chroot status.
string_list chroots
 The chroots to run the session operation in.
config_ptr config
 The chroot configuration.
bool force
 The session force status.
struct sigaction saved_signals
 Signals saved while sighup handler is set.
std::string session_id
 The session identifier.
operation session_operation
 The session operation to perform.

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

Generated by  Doxygen 1.6.0   Back to index