line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################### |
2
|
|
|
|
|
|
|
package PasswordMonkey::Bouncer::Wait; |
3
|
|
|
|
|
|
|
########################################### |
4
|
3
|
|
|
3
|
|
1601
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
89
|
|
5
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
77
|
|
6
|
3
|
|
|
3
|
|
22
|
use base qw(PasswordMonkey::Bouncer); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1474
|
|
7
|
3
|
|
|
3
|
|
14
|
use Log::Log4perl qw(:easy); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
20
|
|
8
|
3
|
|
|
3
|
|
4747
|
use Data::Dumper; |
|
3
|
|
|
|
|
30593
|
|
|
3
|
|
|
|
|
981
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
PasswordMonkey::make_accessor( __PACKAGE__, $_ ) for qw( |
11
|
|
|
|
|
|
|
seconds |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
########################################### |
15
|
|
|
|
|
|
|
sub init { |
16
|
|
|
|
|
|
|
########################################### |
17
|
10
|
|
|
10
|
0
|
84
|
my($self) = @_; |
18
|
|
|
|
|
|
|
|
19
|
10
|
|
|
|
|
162
|
$self->{name} = "Wait For Unexpected Input"; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
########################################### |
23
|
|
|
|
|
|
|
sub check { |
24
|
|
|
|
|
|
|
########################################### |
25
|
10
|
|
|
10
|
0
|
22
|
my($self) = @_; |
26
|
|
|
|
|
|
|
|
27
|
10
|
|
|
|
|
51
|
$self->{got_output} = 0; |
28
|
|
|
|
|
|
|
|
29
|
10
|
|
|
|
|
121
|
DEBUG "Waiting $self->{seconds} seconds for unexpected output"; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$self->{expect}->expect( |
32
|
|
|
|
|
|
|
$self->{seconds}, |
33
|
|
|
|
|
|
|
[ qr/./ => sub { |
34
|
3
|
|
|
3
|
|
1000501
|
$self->{got_output} = 1; |
35
|
|
|
|
|
|
|
# We got undesired input, abort without exp_continue |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
10
|
|
|
|
|
316
|
] |
39
|
|
|
|
|
|
|
); |
40
|
|
|
|
|
|
|
|
41
|
10
|
100
|
|
|
|
13017515
|
if( $self->{got_output} ) { |
42
|
3
|
|
|
|
|
65
|
LOGWARN "Whoa, ", __PACKAGE__, " received unexpected output ", |
43
|
|
|
|
|
|
|
" ('", $self->{expect}->match(), "') within ", |
44
|
|
|
|
|
|
|
"$self->{seconds} secs moratorium. Won't send anything over."; |
45
|
3
|
|
|
|
|
415
|
return 0; |
46
|
|
|
|
|
|
|
} else { |
47
|
7
|
|
|
|
|
124
|
DEBUG "No output within $self->{seconds} seconds. We're good."; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
7
|
|
|
|
|
190
|
return 1; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |