diff -Nur e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/db/configuration/defaults/nut/access e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/db/configuration/defaults/nut/access --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/db/configuration/defaults/nut/access 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/db/configuration/defaults/nut/access 2015-01-24 10:12:37.561073849 +0100 @@ -0,0 +1 @@ +localhost 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-24 11:37:13.744722139 +0100 @@ -0,0 +1,14 @@ +{ + use esmith::ConfigDB; + my $db = esmith::ConfigDB->open_ro or die ("Unable to open the configuration database"); + my $access = $db->get_prop('nut','access')||'localhost'; + + if ($access ne 'public') + { + $DB->hosts_allow_spec('nut','nut'); + } + else + { + $OUT .= "# 'nut' can not be opened outside of your local network"; + } +} diff -Nur e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/services/30Nut e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/services/30Nut --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/services/30Nut 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/services/30Nut 2015-01-22 11:15:15.714961712 +0100 @@ -0,0 +1,3 @@ +#Nut Service +nut 3493/tcp # Network UPS Tools +nut 3493/udp # Network UPS Tools 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-24 10:47:33.993398580 +0100 @@ -0,0 +1,10 @@ +{ +use esmith::ConfigDB; +my $db = esmith::ConfigDB->open_ro or die ("Unable to open configuration database"); + +my $localip = $db->get_value("LocalIP") || ''; +my $access = $db->get_prop("nut","access") || 'localhost'; + +$OUT .= "LISTEN 127.0.0.1"; +$OUT .= "\nLISTEN $localip" if ($access eq 'private'); +} 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