sbuild  1.6.5
sbuild-auth-pam-conv.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_CONV_H
20 #define SBUILD_AUTH_PAM_CONV_H
21 
22 #include <sbuild/sbuild-auth-pam-message.h>
23 #include <sbuild/sbuild-error.h>
24 #include <sbuild/sbuild-tr1types.h>
25 
26 #include <vector>
27 
28 #include <security/pam_appl.h>
29 
30 namespace sbuild
31 {
32 
33  class auth_pam;
34 
58  {
59  public:
61  typedef std::vector<auth_pam_message> message_list;
63  typedef std::shared_ptr<auth_pam> auth_ptr;
65  typedef std::weak_ptr<auth_pam> weak_auth_ptr;
67  typedef std::shared_ptr<auth_pam_conv> ptr;
68 
69  protected:
71  auth_pam_conv ();
72 
73  public:
75  virtual ~auth_pam_conv ();
76 
82  virtual auth_ptr
83  get_auth () = 0;
84 
90  virtual void
91  set_auth (auth_ptr auth) = 0;
92 
98  virtual time_t
99  get_warning_timeout () = 0;
100 
106  virtual void
107  set_warning_timeout (time_t timeout) = 0;
108 
115  virtual time_t
116  get_fatal_timeout () = 0;
117 
124  virtual void
125  set_fatal_timeout (time_t timeout) = 0;
126 
141  virtual void
142  conversation (message_list& messages) = 0;
143  };
144 
145 }
146 
147 #endif /* SBUILD_AUTH_PAM_CONV_H */
148 
149 /*
150  * Local Variables:
151  * mode:C++
152  * End:
153  */