dchroot_dsa::session Class Reference

Session handler for dchroot-dsa sessions. More...

#include <dchroot-dsa-session.h>

Inheritance diagram for dchroot_dsa::session:

Inheritance graph
[legend]
Collaboration diagram for dchroot_dsa::session:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 session (std::string const &service, config_ptr &config, operation operation, sbuild::string_list const &chroots, bool compat)
 The constructor.
virtual ~session ()
 The destructor.
virtual sbuild::auth::status get_chroot_auth_status (sbuild::auth::status status, sbuild::chroot::ptr const &chroot) const
 Check if authentication is required for a single chroot, taking users, groups, root-users and root-groups membership into account.
virtual sbuild::string_list get_login_directories () const
 Get a list of directories to change to when running a login shell.
virtual void get_user_command (sbuild::chroot::ptr &session_chroot, std::string &file, sbuild::string_list &command) const
 Get the command to run a user command.

Detailed Description

Session handler for dchroot-dsa sessions.

This class provides the session handling for dchroot-dsa compatibility. It overrides the normal authentication checks to allow all users to access the service, but enforce dchroot-dsa user access controls when present, and it specialises the session behaviour to be compatible with the chdir and command execution behaviour of dchroot-dsa.

Definition at line 38 of file dchroot-dsa-session.h.


Constructor & Destructor Documentation

session::session ( 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).

Definition at line 44 of file dchroot-dsa-session.cc.

session::~session (  )  [virtual]

The destructor.

Reimplemented from sbuild::session.

Definition at line 53 of file dchroot-dsa-session.cc.


Member Function Documentation

sbuild::auth::status session::get_chroot_auth_status ( sbuild::auth::status  status,
sbuild::chroot::ptr const &  chroot 
) const [virtual]

Check if authentication is required for a single chroot, taking users, groups, root-users and root-groups membership into account.

Reimplemented from sbuild::session.

Definition at line 58 of file dchroot-dsa-session.cc.

References sbuild::auth::change_auth(), sbuild::session::get_chroot_auth_status(), dchroot::session_base::get_compat(), and sbuild::auth::get_uid().

Here is the call graph for this function:

sbuild::string_list session::get_login_directories (  )  const [virtual]

Get a list of directories to change to when running a login shell.

Multiple directories are used as fallbacks.

Returns:
a list of directories

Reimplemented from sbuild::session.

Definition at line 90 of file dchroot-dsa-session.cc.

References sbuild::auth::get_home(), sbuild::auth::get_wd(), and sbuild::auth::wd.

Here is the call graph for this function:

void session::get_user_command ( sbuild::chroot::ptr session_chroot,
std::string &  file,
sbuild::string_list command 
) const [virtual]

Get the command to run a user command.

Parameters:
session_chroot the chroot to setup. This must be present in the chroot list and the chroot configuration object.
file the filename to pass to execve(2).
command the argv to pass to execve(2).

Reimplemented from sbuild::session.

Definition at line 113 of file dchroot-dsa-session.cc.

References _, sbuild::session::COMMAND_ABS, sbuild::DEBUG_NOTICE, sbuild::auth::get_ruid(), sbuild::auth::get_ruser(), sbuild::auth::get_uid(), sbuild::auth::get_user(), sbuild::auth::get_verbosity(), sbuild::is_absname(), sbuild::log_debug(), sbuild::log_info(), and sbuild::string_list_to_string().

Here is the call graph for this function:


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