1 |
stephdl |
1.1 |
diff -Nur e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/db/configuration/defaults/nut/AdminUser e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/db/configuration/defaults/nut/AdminUser |
2 |
|
|
--- e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/db/configuration/defaults/nut/AdminUser 1970-01-01 01:00:00.000000000 +0100 |
3 |
|
|
+++ e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/db/configuration/defaults/nut/AdminUser 2015-02-02 22:07:53.832289812 +0100 |
4 |
|
|
@@ -0,0 +1 @@ |
5 |
|
|
+disabled |
6 |
|
|
diff -Nur e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/db/configuration/migrate/nutPass e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/db/configuration/migrate/nutPass |
7 |
|
|
--- e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/db/configuration/migrate/nutPass 2015-02-02 22:01:00.390892204 +0100 |
8 |
|
|
+++ e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/db/configuration/migrate/nutPass 2015-02-02 22:06:52.485631128 +0100 |
9 |
|
|
@@ -4,4 +4,5 @@ |
10 |
|
|
my $nutrec = $DB->get('nut') || $DB->new_record('nut', {type => 'service'}); |
11 |
|
|
$nutrec->set_prop('MasterPass', sprintf("%15.0f", int( (1000000000000000) * rand() ))) if not $nutrec->prop('MasterPass'); |
12 |
|
|
$nutrec->set_prop('SlavePass', sprintf("%15.0f", int( (1000000000000000) * rand() ))) if not $nutrec->prop('SlavePass'); |
13 |
|
|
+ $nutrec->set_prop('AdminPass', sprintf("%15.0f", int( (1000000000000000) * rand() ))) if not $nutrec->prop('AdminPass'); |
14 |
|
|
} |
15 |
|
|
diff -Nur e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/templates/etc/hosts.allow/upsd_admin_privileges e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/templates/etc/hosts.allow/upsd_admin_privileges |
16 |
|
|
--- e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/templates/etc/hosts.allow/upsd_admin_privileges 1970-01-01 01:00:00.000000000 +0100 |
17 |
|
|
+++ e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/templates/etc/hosts.allow/upsd_admin_privileges 2015-02-02 23:14:22.294683885 +0100 |
18 |
|
|
@@ -0,0 +1,4 @@ |
19 |
|
|
+{ |
20 |
|
|
+$OUT .= qq (#Allow the Admin User of upsd |
21 |
|
|
+upsd : admin op localhost : ALLOW) if ($nut{AdminUser} eq 'enabled'); |
22 |
|
|
+} |
23 |
|
|
diff -Nur e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/templates/etc/ups/upsd.users/upsd_administrative_privileges e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/templates/etc/ups/upsd.users/upsd_administrative_privileges |
24 |
|
|
--- e-smith-nutUPS-2.4.0.old8826/root/etc/e-smith/templates/etc/ups/upsd.users/upsd_administrative_privileges 1970-01-01 01:00:00.000000000 +0100 |
25 |
|
|
+++ e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/templates/etc/ups/upsd.users/upsd_administrative_privileges 2015-02-03 18:30:18.317396319 +0100 |
26 |
|
|
@@ -0,0 +1,14 @@ |
27 |
|
|
+{ |
28 |
|
|
+ # create admin user for upsd to allow setting of |
29 |
|
|
+ # UPS parameters via upsrw |
30 |
|
|
+ |
31 |
|
|
+ $OUT .= ""; |
32 |
|
|
+ return unless (($nut{AdminUser} || 'disabled') eq 'enabled'); |
33 |
|
|
+ return unless (($nut{AdminPass} || '') ne ''); |
34 |
|
|
+ |
35 |
|
|
+ $OUT .= "\n"; |
36 |
|
|
+ $OUT .= " [admin]\n"; |
37 |
|
|
+ $OUT .= " password = $nut{AdminPass}\n"; |
38 |
|
|
+ $OUT .= " actions = set\n"; |
39 |
|
|
+ $OUT .= " instcmds = all\n"; |
40 |
|
|
+} |