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 --- e-smith-base-5.8.1.old/root/sbin/e-smith/generate-subjectaltnames 2021-06-06 16:30:37.000000000 -0400 +++ e-smith-base-5.8.1/root/sbin/e-smith/generate-subjectaltnames 2021-06-06 16:46:09.625000000 -0400 @@ -20,6 +20,11 @@ my $configuration = esmith::ConfigDB->open_ro('configuration') or die "Couldn't open configuration DB\n"; +my $domains = esmith::ConfigDB->open_ro('domains') + or die "Couldn't open domains DB\n"; + +my $hosts = esmith::ConfigDB->open_ro('hosts') + or die "Couldn't open domains DB\n"; my %results_dict = (); @@ -62,10 +67,34 @@ } #---------------------------------------------------------------------- +# Add all domains defined +#---------------------------------------------------------------------- +my $modSSL = $configuration->get('modSSL'); +my $AddDomains = $modSSL->prop('AddDomains') || "enabled"; +if ( $AddDomains eq "enabled" ) +{ + foreach my $domain ( $domains->get_all_by_prop(type => 'domain') ) + { + $results_dict{$domain->key} = 1; + } +} + +#---------------------------------------------------------------------- +# Add all domains defined +#---------------------------------------------------------------------- +my $AddHosts = $modSSL->prop('AddHosts') || "enabled"; +if ( $AddHosts eq "enabled" ) +{ + foreach my $host ( $hosts->get_all_by_prop(type => 'host') ) + { + $results_dict{$host->key} = 1; + } +} + +#---------------------------------------------------------------------- # Add any alternate names specified in the modSSL config DB. #---------------------------------------------------------------------- -$modSSL = $configuration->get('modSSL'); if ($modSSL) { $AlternateNames = $modSSL->prop('AlternateNames');