1 |
stephdl |
1.1 |
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 |
2 |
|
|
--- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/hosts.allow/upsd 1970-01-01 01:00:00.000000000 +0100 |
3 |
|
|
+++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/hosts.allow/upsd 2015-01-22 09:18:14.317537036 +0100 |
4 |
|
|
@@ -0,0 +1,3 @@ |
5 |
|
|
+{ |
6 |
|
|
+ $DB->hosts_allow_spec('nut','upsd'); |
7 |
|
|
+} |
8 |
|
|
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 |
9 |
|
|
--- 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 |
10 |
|
|
+++ 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 |
11 |
|
|
@@ -0,0 +1,26 @@ |
12 |
|
|
+{ |
13 |
|
|
+ use strict; |
14 |
|
|
+ use warnings; |
15 |
|
|
+ use esmith::ConfigDB; |
16 |
|
|
+ use Net::IPv4Addr qw( ipv4_broadcast ipv4_parse ); |
17 |
|
|
+ use Net::IP; |
18 |
|
|
+ |
19 |
|
|
+ #Variable declaration |
20 |
|
|
+ my $config = esmith::ConfigDB->open_ro || die ("Unable to open the configuration database"); |
21 |
|
|
+ my $network = $config->get_prop('InternalInterface','Network'); |
22 |
|
|
+ my $netmask = $config->get_prop('InternalInterface','Netmask'); |
23 |
|
|
+ my $ipaddress = $config->get_prop('InternalInterface','IPAddress'); |
24 |
|
|
+ |
25 |
|
|
+ my $network_cidr = ipv4_parse($network,$netmask); |
26 |
|
|
+ my $broadcast = ipv4_broadcast($network,$netmask); |
27 |
|
|
+ my $ip = new Net::IP ("$network_cidr") || die ("Unable to generate the list of UPS Listen IP"); |
28 |
|
|
+ |
29 |
|
|
+ #Allow the localhost |
30 |
|
|
+ $OUT .= "LISTEN 127.0.0.1\n"; |
31 |
|
|
+ # Loop to display all IP |
32 |
|
|
+ do { |
33 |
|
|
+ my $display = $ip->ip(); |
34 |
|
|
+ #we want to remove the network, the server IP and the brodcast IP |
35 |
|
|
+ $OUT .= "LISTEN $display\n" if (($display ne $network)&&($display ne $broadcast)&&($display ne $ipaddress)); |
36 |
|
|
+ } while (++$ip); |
37 |
|
|
+} |
38 |
|
|
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 |
39 |
|
|
--- 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 |
40 |
|
|
+++ 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 |
41 |
|
|
@@ -1,3 +0,0 @@ |
42 |
|
|
-ACL all 0.0.0.0/0 |
43 |
|
|
-ACL localhost 127.0.0.1/32 |
44 |
|
|
-ACL localnet { "$InternalInterface{Network}/$InternalInterface{Netmask}" } |
45 |
|
|
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 |
46 |
|
|
--- 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 |
47 |
|
|
+++ 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 |
48 |
|
|
@@ -1,3 +0,0 @@ |
49 |
|
|
-ACCEPT localhost |
50 |
|
|
-ACCEPT localnet |
51 |
|
|
-REJECT all |