line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cvs::Simple::Hook; |
2
|
9
|
|
|
9
|
|
56
|
use common::sense; |
|
9
|
|
|
|
|
19
|
|
|
9
|
|
|
|
|
71
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
# Version set by dist.ini; do not change here. |
5
|
|
|
|
|
|
|
our $VERSION = '0.07_04'; # VERSION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
{ |
9
|
|
|
|
|
|
|
my(%PERMITTED) = ( |
10
|
|
|
|
|
|
|
'All' => '', |
11
|
|
|
|
|
|
|
'add' => '', |
12
|
|
|
|
|
|
|
'checkout' => '', |
13
|
|
|
|
|
|
|
'commit' => '', |
14
|
|
|
|
|
|
|
'update' => '', |
15
|
|
|
|
|
|
|
'diff' => '', |
16
|
|
|
|
|
|
|
'status' => '', |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub PERM_REQ () |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
0
|
1
|
0
|
my $patt = join '|' => keys %PERMITTED; |
23
|
0
|
|
|
|
|
0
|
return qr/$patt/; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub permitted ($) |
28
|
|
|
|
|
|
|
{ |
29
|
4
|
50
|
|
4
|
1
|
33
|
return exists $PERMITTED{$_[0]} ? 1 : 0; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_hook ($) |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
0
|
1
|
|
my $cmd = shift; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my $PERM_REQ = PERM_REQ; |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
if(($cmd)=~/\b($PERM_REQ)\b/) { |
40
|
0
|
|
|
|
|
|
return $1; |
41
|
|
|
|
|
|
|
} else { |
42
|
0
|
|
|
|
|
|
return; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# ABSTRACT: limits allowed cvs commands. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |