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/Server/UCSPI/NegKrb5.pm $ |
3
|
|
|
|
|
|
|
# $LastChangedRevision: 1321 $ |
4
|
|
|
|
|
|
|
# $LastChangedDate: 2008-10-01 16:16:56 +0100 (Wed, 01 Oct 2008) $ |
5
|
|
|
|
|
|
|
# $LastChangedBy: oliver $ |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
package RPC::Serialized::Server::UCSPI::NegKrb5; |
8
|
|
|
|
|
|
|
{ |
9
|
|
|
|
|
|
|
$RPC::Serialized::Server::UCSPI::NegKrb5::VERSION = '1.123630'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
789
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
13
|
1
|
|
|
1
|
|
5
|
use warnings FATAL => 'all'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
132
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
6
|
use base 'RPC::Serialized::Server::UCSPI'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
615
|
|
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
7
|
use RPC::Serialized::Exceptions; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
21
|
0
|
|
|
|
|
|
my $params = RPC::Serialized::Config->parse(@_); |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new($params); |
24
|
0
|
|
|
|
|
|
$self->{KRB5_REALM} = $params->me->{krb5_realm}; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# FIXME should be an accessor? |
30
|
|
|
|
|
|
|
sub krb5_realm { |
31
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
32
|
0
|
0
|
|
|
|
|
if (@_) { |
33
|
0
|
|
|
|
|
|
$self->{KRB5_REALM} = shift; |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
return $self->{KRB5_REALM}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub subject { |
39
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
my $rprinc = $ENV{NEGKRB5REMOTEPRINC} |
42
|
|
|
|
|
|
|
or throw_authz 'NEGKRB5REMOTEPRINC not set'; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $realm = $self->{KRB5_REALM}; |
45
|
0
|
0
|
|
|
|
|
( my $subject = $rprinc ) =~ s/\@\Q$realm\E$// |
46
|
|
|
|
|
|
|
or throw_authz "Realm for principal $rprinc not recognized"; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return $subject; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|