1 |
jpp |
1.1 |
diff -Nur --no-dereference e-smith-base-5.8.1.old/root/sbin/e-smith/generate-subjectaltnames e-smith-base-5.8.1/root/sbin/e-smith/generate-subjectaltnames |
2 |
|
|
--- e-smith-base-5.8.1.old/root/sbin/e-smith/generate-subjectaltnames 2022-07-29 21:53:06.043000000 -0400 |
3 |
|
|
+++ e-smith-base-5.8.1/root/sbin/e-smith/generate-subjectaltnames 2022-07-29 21:58:42.462000000 -0400 |
4 |
|
|
@@ -17,13 +17,14 @@ |
5 |
|
|
#---------------------------------------------------------------------- |
6 |
|
|
|
7 |
|
|
use esmith::ConfigDB; |
8 |
|
|
+use esmith::HostsDB; |
9 |
|
|
|
10 |
|
|
my $configuration = esmith::ConfigDB->open_ro('configuration') |
11 |
|
|
or die "Couldn't open configuration DB\n"; |
12 |
|
|
my $domains = esmith::ConfigDB->open_ro('domains') |
13 |
|
|
or die "Couldn't open domains DB\n"; |
14 |
|
|
|
15 |
|
|
-my $hosts = esmith::ConfigDB->open_ro('hosts') |
16 |
|
|
+my $hosts = esmith::HostsDB->open_ro() |
17 |
|
|
or die "Couldn't open domains DB\n"; |
18 |
|
|
|
19 |
|
|
my %results_dict = (); |
20 |
|
|
@@ -80,14 +81,18 @@ |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
#---------------------------------------------------------------------- |
24 |
|
|
-# Add all domains defined |
25 |
|
|
+# Add all hosts per domains defined |
26 |
|
|
#---------------------------------------------------------------------- |
27 |
|
|
my $AddHosts = $modSSL->prop('AddHosts') || "enabled"; |
28 |
|
|
if ( $AddHosts eq "enabled" ) |
29 |
|
|
{ |
30 |
|
|
- foreach my $host ( $hosts->get_all_by_prop(type => 'host') ) |
31 |
|
|
+ foreach my $domain ($domains->get_all_by_prop(type => 'domain')) #ignore domain-remote |
32 |
|
|
{ |
33 |
|
|
- $results_dict{$host->key} = 1; |
34 |
|
|
+ foreach my $host ( $hosts->get_hosts_by_domain($domain->key) ) |
35 |
|
|
+ { |
36 |
|
|
+ next unless (($host->prop('HostType')||'undef') eq 'Self'); #only define self host |
37 |
|
|
+ $results_dict{$host->key} = 1; |
38 |
|
|
+ } |
39 |
|
|
} |
40 |
|
|
} |
41 |
|
|
|