sbuild  1.6.5
sbuild-auth-pam-conv-tty.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_TTY_H
20 #define SBUILD_AUTH_PAM_CONV_TTY_H
21 
22 #include <sbuild/sbuild-auth-pam-conv.h>
23 #include <sbuild/sbuild-auth.h>
24 #include <sbuild/sbuild-custom-error.h>
25 
26 #include <security/pam_appl.h>
27 #include <security/pam_misc.h>
28 
29 namespace sbuild
30 {
46  {
47  public:
50  {
51  CTTY,
56  };
57 
60 
61  private:
69 
70  public:
72  virtual ~auth_pam_conv_tty ();
73 
81  static ptr
83 
84  virtual auth_ptr
85  get_auth ();
86 
87  virtual void
89 
90  virtual time_t
92 
93  virtual void
94  set_warning_timeout (time_t timeout);
95 
96  virtual time_t
98 
99  virtual void
100  set_fatal_timeout (time_t timeout);
101 
102  virtual void
104 
105  private:
115  int get_delay ();
116 
133  std::string
134  read_string (std::string message,
135  bool echo);
136 
144  time_t start_time;
145  };
146 
147 }
148 
149 #endif /* SBUILD_AUTH_PAM_CONV_TTY_H */
150 
151 /*
152  * Local Variables:
153  * mode:C++
154  * End:
155  */