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

Annotation of /rpms/e-smith-nutUPS/sme9/e-smith-nutUPS-2.4.0.UPS_administrative_privileges.patch

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


Revision 1.4 - (hide annotations) (download)
Sat Feb 7 10:18:12 2015 UTC (9 years, 9 months ago) by stephdl
Branch: MAIN
CVS Tags: e-smith-nutUPS-2_4_0-9_el6_sme, HEAD
Changes since 1.3: +4 -3 lines
* Sat Feb 07 2015 stephane de Labrusse <stephdl@de-labrusse.fr> 2.4.0-9.sme
- Allow the admin upsd in /etc/hosts.allow [SME: 8826]

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 stephdl 1.4 +++ e-smith-nutUPS-2.4.0.bz8826/root/etc/e-smith/templates/etc/hosts.allow/upsd_admin_privileges 2015-02-07 10:41:37.038033536 +0100
18     @@ -0,0 +1,11 @@
19 stephdl 1.1 +{
20 stephdl 1.4 +return "# The upsd admin is not allowed" if ($nut{AdminUser} ne 'enabled');
21     +return "# The upsd admin has no password" if (($nut{AdminPass} || '') eq '');
22 stephdl 1.3 +return "# The upsd admin is not allowed when nut access is set to public" if $nut{access} eq 'public';
23     +
24 stephdl 1.2 +my $upsd = $DB->hosts_allow_spec('nut','upsd');
25 stephdl 1.3 +$upsd =~ s|upsd:|upsd: admin op |;
26 stephdl 1.2 +
27     +$OUT .= qq(#Allow the Admin User of upsd
28 stephdl 1.3 +$upsd : ALLOW) if ($nut{status} eq 'enabled');
29 stephdl 1.1 +}
30     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
31     --- 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
32     +++ 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
33     @@ -0,0 +1,14 @@
34     +{
35     + # create admin user for upsd to allow setting of
36     + # UPS parameters via upsrw
37     +
38     + $OUT .= "";
39     + return unless (($nut{AdminUser} || 'disabled') eq 'enabled');
40     + return unless (($nut{AdminPass} || '') ne '');
41     +
42     + $OUT .= "\n";
43     + $OUT .= " [admin]\n";
44     + $OUT .= " password = $nut{AdminPass}\n";
45     + $OUT .= " actions = set\n";
46     + $OUT .= " instcmds = all\n";
47     +}

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