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

auth::auth ( std::string const &  service_name  ) 

The constructor.

Parameters:
service_name the PAM service name. This should be a hard-coded constant string literal for safety and security. This is passed to pam_start() when initialising PAM, and is used to load the correct configuration file from /etc/pam.d.

Definition at line 96 of file sbuild-auth.cc.

References ruid, ruser, and set_user().

                                        :
  pam(),
  service(service_name),
  uid(0),
  gid(0),
  user(),
  command(),
  home(),
  shell(),
  user_environment(),
  ruid(),
  ruser(),
  conv(dynamic_cast<auth_conv *>(new auth_conv_tty)),
  message_verbosity(VERBOSITY_NORMAL)
{
  this->ruid = getuid();
  struct passwd *pwent = getpwuid(this->ruid);
  if (pwent == 0)
    {
      format fmt(_("%1%: user not found: %2%"));
      fmt % this->ruid% strerror(errno);
      throw error(fmt);
    }
  this->ruser = pwent->pw_name;

  /* By default, the auth user is the same as the remote user. */
  set_user(this->ruser);
}


Generated by  Doxygen 1.6.0   Back to index