line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Ident::Response; |
2
|
|
|
|
|
|
|
|
3
|
9
|
|
|
9
|
|
26654
|
use strict; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
354
|
|
4
|
9
|
|
|
9
|
|
60
|
use warnings; |
|
9
|
|
|
|
|
18
|
|
|
9
|
|
|
|
|
304
|
|
5
|
9
|
|
|
9
|
1
|
9134
|
use AnyEvent::Ident::Response; |
|
9
|
|
|
|
|
1715
|
|
|
9
|
|
|
|
|
2969
|
|
6
|
|
|
|
|
|
|
our @ISA = qw( AnyEvent::Ident::Response ); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: Ident response object |
9
|
|
|
|
|
|
|
our $VERSION = '0.30'; # VERSION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $server_user_uid; |
13
|
|
|
|
|
|
|
my $server_user_name; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
6
|
sub _server_user_uid { $server_user_uid } |
16
|
1
|
|
|
1
|
|
399
|
sub _server_user_name { $server_user_name } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub _setup |
19
|
|
|
|
|
|
|
{ |
20
|
8
|
50
|
|
8
|
|
2228
|
if($^O eq 'MSWin32') |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
|
|
0
|
$server_user_name = $ENV{USERNAME}; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
else |
25
|
|
|
|
|
|
|
{ |
26
|
8
|
|
|
|
|
42
|
$server_user_uid = $<; |
27
|
8
|
|
|
|
|
6774
|
$server_user_name = scalar getpwuid($<); |
28
|
|
|
|
|
|
|
} |
29
|
8
|
50
|
33
|
|
|
116
|
die "could not determine username" |
30
|
|
|
|
|
|
|
unless defined $server_user_name |
31
|
|
|
|
|
|
|
&& $server_user_name; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub same_user |
36
|
|
|
|
|
|
|
{ |
37
|
6
|
|
|
6
|
1
|
1241
|
my($self) = @_; |
38
|
6
|
100
|
|
|
|
28
|
return unless $self->{remote_address} eq '127.0.0.1'; |
39
|
4
|
100
|
|
|
|
10
|
return 1 if $self->username eq $server_user_name; |
40
|
3
|
100
|
66
|
|
|
24
|
return 1 if defined $server_user_uid && $self->username =~ /^\d+$/ && $self->username == $server_user_uid; |
|
|
|
100
|
|
|
|
|
41
|
2
|
|
|
|
|
30
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |