line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*- |
2
|
|
|
|
|
|
|
# vim:ts=8:sw=2:et:sta:sts=2 |
3
|
|
|
|
|
|
|
######### |
4
|
|
|
|
|
|
|
# Author: rmp |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package ClearPress::authenticator::passwd; |
7
|
1
|
|
|
1
|
|
720
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
9
|
1
|
|
|
1
|
|
5
|
use base qw(ClearPress::authenticator); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
367
|
|
10
|
1
|
|
|
1
|
|
9
|
use Carp; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
139
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = q[477.1.4]; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub authen_credentials { |
15
|
6
|
|
|
6
|
1
|
45
|
my ($self, $ref) = @_; |
16
|
|
|
|
|
|
|
|
17
|
6
|
100
|
100
|
|
|
40
|
if(!$ref || |
|
|
|
100
|
|
|
|
|
18
|
|
|
|
|
|
|
!$ref->{username} || |
19
|
|
|
|
|
|
|
!$ref->{password} ) { |
20
|
3
|
|
|
|
|
16
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
13
|
my ($name, $passwd) = getpwnam $ref->{username}; |
24
|
3
|
100
|
|
|
|
32
|
if(!$name) { |
25
|
1
|
|
|
|
|
7
|
return; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
2
|
100
|
|
|
|
636
|
if((crypt $ref->{password}, $passwd) eq $passwd) { |
29
|
1
|
|
|
|
|
4
|
return $ref; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
6
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |