2 # Common functions for the krb5 config
4 BEGIN { push(@INC, ".."); };
9 # Returns the krb5 config
11 local (%conf, $section, $realm);
12 $section = $realm = "";
13 open(FILE, $config{'krb5_conf'});
19 if (/^\[/) { # section name
21 $section =~ s/^\[([^\]]*)\]/\1/;
25 my ($var, $value) = split(/\s*=\s*/, $_, 2);
26 if ($section eq "logging") {
27 if ($value =~ /^FILE:/) { $value =~ s/^FILE://; }
30 if (($section eq "domain_realm") and ($value eq $realm)) {
34 if ($section eq "realms") {
35 if ($value =~ /\{/ ) {
40 if ($var eq "admin_server") {
42 ($value, $port) = split(':', $value, 2);
43 $conf{'admin_port'} = $port;
47 ($value, $port) = split(':', $value, 2);
48 $conf{'kdc_port'} = $port;