line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $HeadURL: https://svn.oucs.ox.ac.uk/people/oliver/pub/librpc-serialized-perl/trunk/lib/RPC/Serialized/ACL/Group/File.pm $ |
3
|
|
|
|
|
|
|
# $LastChangedRevision: 1281 $ |
4
|
|
|
|
|
|
|
# $LastChangedDate: 2008-10-01 16:16:56 +0100 (Wed, 01 Oct 2008) $ |
5
|
|
|
|
|
|
|
# $LastChangedBy: oliver $ |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
package RPC::Serialized::ACL::Group::File; |
8
|
|
|
|
|
|
|
{ |
9
|
|
|
|
|
|
|
$RPC::Serialized::ACL::Group::File::VERSION = '1.123630'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
867
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
85
|
|
13
|
2
|
|
|
2
|
|
11
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
514
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
12
|
use base 'RPC::Serialized::ACL::Group'; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
791
|
|
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
1907
|
use IO::File; |
|
2
|
|
|
|
|
2326
|
|
|
2
|
|
|
|
|
353
|
|
18
|
2
|
|
|
2
|
|
1678
|
use UNIVERSAL; |
|
2
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
10
|
|
19
|
2
|
|
|
2
|
|
54
|
use RPC::Serialized::Exceptions; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
15
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
9
|
|
|
9
|
0
|
12687
|
my $class = shift; |
23
|
9
|
|
|
|
|
14
|
my $uri = shift; |
24
|
|
|
|
|
|
|
|
25
|
9
|
100
|
100
|
|
|
83
|
defined $uri and UNIVERSAL::isa( $uri, 'URI::file' ) |
26
|
|
|
|
|
|
|
or throw_app 'Missing or invalid URI'; |
27
|
|
|
|
|
|
|
|
28
|
5
|
100
|
|
|
|
20
|
my $path = $uri->file |
29
|
|
|
|
|
|
|
or throw_app "Can't determine path from URI " . $uri->as_string; |
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
359
|
return bless { |
32
|
|
|
|
|
|
|
PATH => $path, |
33
|
|
|
|
|
|
|
}, $class; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub path { |
37
|
22
|
|
|
22
|
0
|
1548
|
my $self = shift; |
38
|
22
|
|
|
|
|
62
|
return $self->{PATH}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub is_member { |
42
|
20
|
|
|
20
|
0
|
705
|
my $self = shift; |
43
|
20
|
|
|
|
|
28
|
my $name = shift; |
44
|
|
|
|
|
|
|
|
45
|
20
|
|
|
|
|
40
|
my $path = $self->path; |
46
|
20
|
100
|
|
|
|
100
|
my $fh = IO::File->new( $path, O_RDONLY ) |
47
|
|
|
|
|
|
|
or throw_system "Failed to open $path: $!"; |
48
|
|
|
|
|
|
|
|
49
|
19
|
|
|
|
|
1804
|
while (<$fh>) { |
50
|
42
|
|
|
|
|
69
|
s/#.*$//; |
51
|
42
|
|
|
|
|
79
|
s/^\s+//; |
52
|
42
|
|
|
|
|
147
|
s/\s+$//; |
53
|
42
|
50
|
|
|
|
91
|
next unless length($_); |
54
|
42
|
100
|
|
|
|
434
|
return 1 if $_ eq $name; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
4
|
|
|
|
|
86
|
return 0; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|