| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyright (c) 2012, cPanel, Inc. |
|
2
|
|
|
|
|
|
|
# All rights reserved. |
|
3
|
|
|
|
|
|
|
# http://cpanel.net/ |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the same |
|
6
|
|
|
|
|
|
|
# terms as Perl itself. See the LICENSE file for further details. |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Archive::Tar::Builder::UserCache; |
|
9
|
|
|
|
|
|
|
|
|
10
|
8
|
|
|
8
|
|
565
|
use strict; |
|
|
8
|
|
|
|
|
21
|
|
|
|
8
|
|
|
|
|
244
|
|
|
11
|
8
|
|
|
8
|
|
41
|
use warnings; |
|
|
8
|
|
|
|
|
16
|
|
|
|
8
|
|
|
|
|
1817
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
|
14
|
92
|
|
|
92
|
0
|
12973597
|
my ($class) = @_; |
|
15
|
|
|
|
|
|
|
|
|
16
|
92
|
|
|
|
|
1825
|
return bless { |
|
17
|
|
|
|
|
|
|
'users' => {}, |
|
18
|
|
|
|
|
|
|
'groups' => {} |
|
19
|
|
|
|
|
|
|
}, $class; |
|
20
|
|
|
|
|
|
|
} |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub lookup { |
|
23
|
6672
|
|
|
6672
|
0
|
427574
|
my ( $self, $uid, $gid ) = @_; |
|
24
|
|
|
|
|
|
|
|
|
25
|
6672
|
100
|
|
|
|
20784
|
unless ( exists $self->{'users'}->{$uid} ) { |
|
26
|
45
|
100
|
|
|
|
10178
|
if ( my @pwent = getpwuid($uid) ) { |
|
27
|
44
|
|
|
|
|
562
|
$self->{'users'}->{$uid} = $pwent[0]; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
else { |
|
30
|
1
|
|
|
|
|
6
|
$self->{'users'}->{$uid} = undef; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
6672
|
100
|
|
|
|
14917
|
unless ( exists $self->{'groups'}->{$gid} ) { |
|
35
|
45
|
100
|
|
|
|
2325
|
if ( my @grent = getgrgid($gid) ) { |
|
36
|
44
|
|
|
|
|
258
|
$self->{'groups'}->{$gid} = $grent[0]; |
|
37
|
|
|
|
|
|
|
} |
|
38
|
|
|
|
|
|
|
else { |
|
39
|
1
|
|
|
|
|
5
|
$self->{'groups'}->{$gid} = undef; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
} |
|
42
|
|
|
|
|
|
|
|
|
43
|
6672
|
|
|
|
|
1138229
|
return ( $self->{'users'}->{$uid}, $self->{'groups'}->{$gid} ); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |