22 #include <sbuild/config.h>
23 #include <sbuild/custom-error.h>
24 #include <sbuild/environment.h>
25 #include <sbuild/types.h>
26 #include <sbuild/util.h>
31 #include <sys/types.h>
102 typedef std::shared_ptr<auth>
ptr;
113 auth (
const std::string& service_name);
486 if (newauth > oldauth)
std::string const & get_ruser() const
Get the "remote" name of the user.
Definition: auth.cc:334
Authentication failed.
Definition: auth.h:91
virtual void open_session()
Open a PAM session.
Definition: auth.cc:381
virtual bool is_initialised() const =0
Check if PAM is initialised (i.e.
std::string rgroup
The group name requesting authentication.
Definition: auth.h:525
environment user_environment
The user environment to set.
Definition: auth.h:517
Debian source builder components.
Definition: ctty.cc:31
User not found.
Definition: auth.h:89
gid_t gid
The gid to run as.
Definition: auth.h:505
uid_t get_uid() const
Get the uid of the user.
Definition: auth.cc:153
gid_t get_gid() const
Get the gid of the user.
Definition: auth.cc:159
static status change_auth(status oldauth, status newauth)
Set new authentication status.
Definition: auth.h:482
string_list const & get_command() const
Get the command to run in the session.
Definition: auth.cc:215
std::string const & get_home() const
Get the home directory.
Definition: auth.cc:227
void set_user_environment(char **environment)
Set the user environment to use in the session.
Definition: auth.cc:257
Authentication has failed.
Definition: auth.h:82
virtual void stop()
Stop the PAM system.
Definition: auth.cc:351
PAM was already initialised.
Definition: auth.h:93
std::string home
The home directory.
Definition: auth.h:511
environment get_complete_environment() const
Get the complete environment.
Definition: auth.cc:302
gid_t rgid
The gid requesting authentication.
Definition: auth.h:521
virtual void account()
Do PAM account management (authorisation).
Definition: auth.cc:366
Container of environment variables.
Definition: environment.h:38
error_code
Error codes.
Definition: auth.h:86
std::string ruser
The user name requesting authentication.
Definition: auth.h:523
Authentication is not required.
Definition: auth.h:80
virtual void cred_delete()
Use PAM to delete credentials.
Definition: auth.cc:376
std::string const & get_service() const
Get the PAM service name.
Definition: auth.cc:96
std::string const & get_user() const
Get the name of the user.
Definition: auth.cc:165
uid_t ruid
The uid requesting authentication.
Definition: auth.h:519
auth(const std::string &service_name)
The constructor.
Definition: auth.cc:61
void set_wd(const std::string &wd)
Set the working directory.
Definition: auth.cc:239
Authorisation failed.
Definition: auth.h:92
void set_ruser(uid_t ruid)
Set the "remote" name of the user.
Definition: auth.cc:102
environment get_minimal_environment() const
Get the minimal environment.
Definition: auth.cc:269
virtual void authenticate(status auth_status)
Perform PAM authentication.
Definition: auth.cc:356
std::string const & get_shell() const
Get the name of the shell.
Definition: auth.cc:245
std::vector< std::string > string_list
A string vector.
Definition: types.h:38
Custom error.
Definition: custom-error.h:31
virtual void close_session()
Close a PAM session.
Definition: auth.cc:386
PAM failed to shut down cleanly.
Definition: auth.h:95
virtual environment get_auth_environment() const =0
Get the PAM environment.
virtual void cred_establish()
Use PAM to establish credentials.
Definition: auth.cc:371
std::string const & get_rgroup() const
Get the "remote" name of the group.
Definition: auth.cc:340
PAM error.
Definition: auth.h:94
gid_t get_rgid() const
Get the "remote gid" of the user.
Definition: auth.cc:328
std::string wd
The directory to run in.
Definition: auth.h:513
custom_error< error_code > error
Exception type.
Definition: auth.h:99
std::shared_ptr< auth > ptr
A shared_ptr to a auth object.
Definition: auth.h:102
const std::string service
The PAM service name.
Definition: auth.h:501
System passwd database entry.
Definition: util.h:747
status
Authentication status.
Definition: auth.h:78
environment const & get_user_environment() const
Get the user environment to use in the session.
Definition: auth.cc:251
uid_t get_ruid() const
Get the "remote uid" of the user.
Definition: auth.cc:322
Group not found.
Definition: auth.h:90
Authentication is required by the user.
Definition: auth.h:81
std::string const & get_wd() const
Get the working directory.
Definition: auth.cc:233
virtual void start()
Start the PAM system.
Definition: auth.cc:346
string_list command
The command to run.
Definition: auth.h:509
virtual void setupenv()
Import the user environment into PAM.
Definition: auth.cc:361
std::string user
The user name to run as.
Definition: auth.h:507
void set_command(const string_list &command)
Set the command to run in the session.
Definition: auth.cc:221
uid_t uid
The uid to run as.
Definition: auth.h:503
virtual ~auth()
The destructor.
Definition: auth.cc:82
Failed to get hostname.
Definition: auth.h:88
Authentication handler.
Definition: auth.h:74
std::string shell
The user shell to run.
Definition: auth.h:515
void set_user(uid_t uid)
Set the name of the user.
Definition: auth.cc:171