sbuild  1.6.0
sbuild-auth-pam.h
1 /* Copyright © 2005-2007 Roger Leigh <rleigh@debian.org>
2  *
3  * schroot is free software: you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * schroot is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  *********************************************************************/
18 
19 #ifndef SBUILD_AUTH_PAM_H
20 #define SBUILD_AUTH_PAM_H
21 
22 #include <sbuild/sbuild-auth.h>
23 #include <sbuild/sbuild-auth-pam-conv.h>
24 
25 #include <security/pam_appl.h>
26 
27 namespace sbuild
28 {
29 
37  class auth_pam : public auth
38  {
39  private:
48  auth_pam (std::string const& service_name);
49 
50  public:
54  virtual ~auth_pam ();
55 
65  static auth::ptr
66  create (std::string const& service_name);
67 
68  virtual environment
69  get_auth_environment () const;
70 
77  get_conv ();
78 
84  void
86 
87  virtual void
88  start ();
89 
90  virtual void
91  stop ();
92 
93  virtual void
94  authenticate (status auth_status);
95 
96  virtual void
97  setupenv ();
98 
99  virtual void
100  account ();
101 
102  virtual void
103  cred_establish ();
104 
105  virtual void
106  cred_delete ();
107 
108  virtual void
109  open_session ();
110 
111  virtual void
112  close_session ();
113 
118  virtual bool
119  is_initialised () const;
120 
121  private:
128  const char *
129  pam_strerror (int pam_error);
130 
132  pam_handle_t *pam;
135  };
136 
137 }
138 
139 #endif /* SBUILD_AUTH_PAM_H */
140 
141 /*
142  * Local Variables:
143  * mode:C++
144  * End:
145  */