Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 57 lines (54 sloc) 1.168 kb
fc1c1b24 » jcameron
2007-04-12 Initial checkin of Webmin
1 # krb5-lib.pl
2 # Common functions for the krb5 config
3
23f8f492 » jcameron
2009-03-03 Use new module
4 BEGIN { push(@INC, ".."); };
5 use WebminCore;
fc1c1b24 » jcameron
2007-04-12 Initial checkin of Webmin
6 &init_config();
7
8 # get_config()
9 # Returns the krb5 config
10 sub get_config {
11 local (%conf, $section, $realm);
12 $section = $realm = "";
13 open(FILE, $config{'krb5_conf'});
14 while(<FILE>) {
15 chomp;
16 s/#.*//;
17 s/^\s+//;
18 s/\s+$//;
19 if (/^\[/) { # section name
20 $section = $_;
21 $section =~ s/^\[([^\]]*)\]/\1/;
22 }
23 s/^\[.*$//;
24 next unless length;
25 my ($var, $value) = split(/\s*=\s*/, $_, 2);
26 if ($section eq "logging") {
27 if ($value =~ /^FILE:/) { $value =~ s/^FILE://; }
28 $var = $var . "_log";
29 }
30 if (($section eq "domain_realm") and ($value eq $realm)) {
31 $value = $var;
32 $var = "domain";
33 }
34 if ($section eq "realms") {
35 if ($value =~ /\{/ ) {
36 $realm = $var;
37 $value = $var;
38 $var = "realm";
39 }
40 if ($var eq "admin_server") {
41 my $port;
42 ($value, $port) = split(':', $value, 2);
43 $conf{'admin_port'} = $port;
44 }
45 if ($var eq "kdc") {
46 my $port;
47 ($value, $port) = split(':', $value, 2);
48 $conf{'kdc_port'} = $port;
49 }
50 }
51 $conf{$var} = $value;
52 }
53 close(FILE);
54 return %conf;
55 }
56
57 1;
Something went wrong with that request. Please try again.