diff -Nur e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/hosts.allow/upsd e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/hosts.allow/upsd --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/hosts.allow/upsd 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/hosts.allow/upsd 2015-01-22 09:18:14.317537036 +0100 @@ -0,0 +1,3 @@ +{ + $DB->hosts_allow_spec('nut','upsd'); +} diff -Nur e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/ups/upsd.conf/10Listen_Local_Network e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/ups/upsd.conf/10Listen_Local_Network --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/ups/upsd.conf/10Listen_Local_Network 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/ups/upsd.conf/10Listen_Local_Network 2015-01-22 09:32:12.197591624 +0100 @@ -0,0 +1,26 @@ +{ + use strict; + use warnings; + use esmith::ConfigDB; + use Net::IPv4Addr qw( ipv4_broadcast ipv4_parse ); + use Net::IP; + + #Variable declaration + my $config = esmith::ConfigDB->open_ro || die ("Unable to open the configuration database"); + my $network = $config->get_prop('InternalInterface','Network'); + my $netmask = $config->get_prop('InternalInterface','Netmask'); + my $ipaddress = $config->get_prop('InternalInterface','IPAddress'); + + my $network_cidr = ipv4_parse($network,$netmask); + my $broadcast = ipv4_broadcast($network,$netmask); + my $ip = new Net::IP ("$network_cidr") || die ("Unable to generate the list of UPS Listen IP"); + + #Allow the localhost + $OUT .= "LISTEN 127.0.0.1\n"; + # Loop to display all IP + do { + my $display = $ip->ip(); + #we want to remove the network, the server IP and the brodcast IP + $OUT .= "LISTEN $display\n" if (($display ne $network)&&($display ne $broadcast)&&($display ne $ipaddress)); + } while (++$ip); +} diff -Nur e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL 2015-01-22 08:59:03.647593780 +0100 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -ACL all 0.0.0.0/0 -ACL localhost 127.0.0.1/32 -ACL localnet { "$InternalInterface{Network}/$InternalInterface{Netmask}" } diff -Nur e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS 2015-01-22 08:59:03.647593780 +0100 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -ACCEPT localhost -ACCEPT localnet -REJECT all