sbuild
1.7.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
lib
sbuild
auth
pam-conv-tty.h
1
/* Copyright © 2005-2013 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/auth/pam-conv.h>
23
#include <sbuild/auth/auth.h>
24
#include <sbuild/custom-error.h>
25
26
#include <security/pam_appl.h>
27
#include <security/pam_misc.h>
28
29
namespace
sbuild
30
{
31
namespace
auth
32
{
33
48
class
pam_conv_tty
:
public
pam_conv
49
{
50
public
:
52
enum
error_code
53
{
54
CTTY
,
55
TIMEOUT
,
56
TIMEOUT_PENDING
,
57
TERMIOS
,
58
CONV_TYPE
59
};
60
62
typedef
custom_error<error_code>
error
;
63
64
private
:
71
pam_conv_tty
(
auth_ptr
auth
);
72
73
public
:
75
virtual
~pam_conv_tty
();
76
84
static
ptr
85
create
(
auth_ptr
auth
);
86
87
virtual
auth_ptr
88
get_auth
();
89
90
virtual
void
91
set_auth
(
auth_ptr
auth
);
92
93
virtual
time_t
94
get_warning_timeout
();
95
96
virtual
void
97
set_warning_timeout
(time_t timeout);
98
99
virtual
time_t
100
get_fatal_timeout
();
101
102
virtual
void
103
set_fatal_timeout
(time_t timeout);
104
105
virtual
void
106
conversation
(
pam_conv::message_list
& messages);
107
108
private
:
118
int
get_delay
();
119
136
std::string
137
read_string
(std::string message,
138
bool
echo);
139
141
weak_auth_ptr
auth
;
143
time_t
warning_timeout
;
145
time_t
fatal_timeout
;
147
time_t
start_time
;
148
};
149
150
}
151
}
152
153
#endif
/* SBUILD_AUTH_PAM_CONV_TTY_H */
154
155
/*
156
* Local Variables:
157
* mode:C++
158
* End:
159
*/
Generated on Wed Oct 2 2013 10:21:07 for sbuild by
1.8.4