#include <dchroot-session-base.h>
Inheritance diagram for dchroot::session_base:
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? |
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.
Definition at line 36 of file dchroot-session-base.h.
session_base::session_base | ( | std::string const & | service, | |
config_ptr & | config, | |||
operation | operation, | |||
sbuild::string_list const & | chroots, | |||
bool | compat | |||
) |
The constructor.
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-session-base.cc.
session_base::~session_base | ( | ) | [virtual] |
bool session_base::get_compat | ( | ) | const |
Get the dchroot compatibility state.
Definition at line 59 of file dchroot-session-base.cc.
References compat.
Referenced by dchroot::session::get_chroot_auth_status(), and dchroot_dsa::session::get_chroot_auth_status().
Here is the caller graph for this function:
void session_base::set_compat | ( | bool | state | ) |
Set the dchroot compatibility state.
state | the dchroot compatibility state. |
Definition at line 65 of file dchroot-session-base.cc.
References compat.
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.
Definition at line 71 of file dchroot-session-base.cc.
References _, sbuild::auth::get_ruid(), sbuild::auth::get_ruser(), sbuild::auth::get_uid(), sbuild::auth::get_user(), sbuild::session::run_impl(), and sbuild::session::USER_SWITCH.
Here is the call graph for this function:
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.
Reimplemented from sbuild::session.
Definition at line 81 of file dchroot-session-base.cc.
References sbuild::session::get_login_directories().
Here is the call graph for this function:
bool dchroot::session_base::compat [private] |
dchroot compatibility enabled?
Definition at line 83 of file dchroot-session-base.h.
Referenced by get_compat(), and set_compat().