/[smeserver]/rpms/e-smith-nutUPS/sme9/e-smith-nutUPS-2.4.0.Listen_Local_Network.patch
ViewVC logotype

Contents of /rpms/e-smith-nutUPS/sme9/e-smith-nutUPS-2.4.0.Listen_Local_Network.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Sun Jan 25 16:53:38 2015 UTC (9 years, 4 months ago) by stephdl
Branch: MAIN
CVS Tags: e-smith-nutUPS-2_4_0-4_el6_sme
Changes since 1.2: +31 -7 lines
* Sun Jan 25 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-4.sme
- Access property created (default value is localhost) [SME: 8793]

1 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
2 --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/db/configuration/defaults/nut/access 1970-01-01 01:00:00.000000000 +0100
3 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/db/configuration/defaults/nut/access 2015-01-24 10:12:37.561073849 +0100
4 @@ -0,0 +1 @@
5 +localhost
6 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
7 --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/hosts.allow/upsd 1970-01-01 01:00:00.000000000 +0100
8 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/hosts.allow/upsd 2015-01-24 11:37:13.744722139 +0100
9 @@ -0,0 +1,14 @@
10 +{
11 + use esmith::ConfigDB;
12 + my $db = esmith::ConfigDB->open_ro or die ("Unable to open the configuration database");
13 + my $access = $db->get_prop('nut','access')||'localhost';
14 +
15 + if ($access ne 'public')
16 + {
17 + $DB->hosts_allow_spec('nut','nut');
18 + }
19 + else
20 + {
21 + $OUT .= "# 'nut' can not be opened outside of your local network";
22 + }
23 +}
24 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
25 --- e-smith-nutUPS-2.4.0.old8793/root/etc/e-smith/templates/etc/services/30Nut 1970-01-01 01:00:00.000000000 +0100
26 +++ e-smith-nutUPS-2.4.0.bz8793/root/etc/e-smith/templates/etc/services/30Nut 2015-01-22 11:15:15.714961712 +0100
27 @@ -0,0 +1,3 @@
28 +#Nut Service
29 +nut 3493/tcp # Network UPS Tools
30 +nut 3493/udp # Network UPS Tools
31 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
32 --- 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
33 +++ 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
34 @@ -0,0 +1,10 @@
35 +{
36 +use esmith::ConfigDB;
37 +my $db = esmith::ConfigDB->open_ro or die ("Unable to open configuration database");
38 +
39 +my $localip = $db->get_value("LocalIP") || '';
40 +my $access = $db->get_prop("nut","access") || 'localhost';
41 +
42 +$OUT .= "LISTEN 127.0.0.1";
43 +$OUT .= "\nLISTEN $localip" if ($access eq 'private');
44 +}
45 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
46 --- 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
47 +++ 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
48 @@ -1,3 +0,0 @@
49 -ACL all 0.0.0.0/0
50 -ACL localhost 127.0.0.1/32
51 -ACL localnet { "$InternalInterface{Network}/$InternalInterface{Netmask}" }
52 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
53 --- 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
54 +++ 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
55 @@ -1,3 +0,0 @@
56 -ACCEPT localhost
57 -ACCEPT localnet
58 -REJECT all

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed