line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Authen::Pluggable::Passwd; |
2
|
|
|
|
|
|
|
$Authen::Pluggable::Passwd::VERSION = '0.03'; |
3
|
3
|
|
|
3
|
|
1162
|
use Mojo::Base -base, -signatures; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
18
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
1640
|
use Authen::Simple::Passwd; |
|
3
|
|
|
|
|
44204
|
|
|
3
|
|
|
|
|
16
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
has 'parent' => undef, weak => 1; |
8
|
|
|
|
|
|
|
has _cfg => sub { return { file => '/etc/passwd' } }; |
9
|
|
|
|
|
|
|
|
10
|
9
|
|
|
9
|
0
|
35
|
sub authen ( $s, $user, $pass ) { |
|
9
|
|
|
|
|
12
|
|
|
9
|
|
|
|
|
8
|
|
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
9
|
|
11
|
9
|
|
|
|
|
17
|
my $auth = Authen::Simple::Passwd->new( path => $s->_cfg->{file} ); |
12
|
|
|
|
|
|
|
|
13
|
9
|
100
|
|
|
|
1267
|
return undef unless $auth->authenticate($user, $pass); |
14
|
|
|
|
|
|
|
# SU $_ c'รจ la riga autenticata |
15
|
5
|
|
|
|
|
56756
|
my (undef,undef,$uid, $gid, $cn, $home, $shell) = split /:/; |
16
|
5
|
|
|
|
|
54
|
return { user => $user, cn => $cn, gid => $gid, uid => $uid }; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
7
|
|
|
7
|
0
|
253
|
sub cfg ($s, %cfg) { |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
8
|
|
20
|
|
|
|
|
|
|
|
21
|
7
|
50
|
|
|
|
13
|
if (%cfg) { |
22
|
7
|
|
|
|
|
23
|
while (my ($k, $v) = each %cfg) { |
23
|
7
|
|
|
|
|
17
|
$s->_cfg->{$k} = $v; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
7
|
|
|
|
|
12
|
return $s->parent; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Authen::Pluggable::Passwd - Authentication via a passwd file |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 0.03 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 AUTHOR |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Emiliano Bruni |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Emiliano Bruni. |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
50
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |