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
|
|
536
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
8
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
9
|
1
|
|
|
1
|
|
4
|
use base qw(ClearPress::authenticator); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
279
|
|
10
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
115
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = q[476.4.2]; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub authen_credentials { |
15
|
6
|
|
|
6
|
1
|
30
|
my ($self, $ref) = @_; |
16
|
|
|
|
|
|
|
|
17
|
6
|
100
|
100
|
|
|
28
|
if(!$ref || |
|
|
|
100
|
|
|
|
|
18
|
|
|
|
|
|
|
!$ref->{username} || |
19
|
|
|
|
|
|
|
!$ref->{password} ) { |
20
|
3
|
|
|
|
|
10
|
return; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
8
|
my ($name, $passwd) = getpwnam $ref->{username}; |
24
|
3
|
100
|
|
|
|
23
|
if(!$name) { |
25
|
1
|
|
|
|
|
3
|
return; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
2
|
100
|
|
|
|
368
|
if((crypt $ref->{password}, $passwd) eq $passwd) { |
29
|
1
|
|
|
|
|
3
|
return $ref; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
5
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |