diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass --- e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass 1969-12-31 17:00:00.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass 2006-12-21 12:55:28.000000000 -0700 @@ -0,0 +1,52 @@ +{ + use MIME::Base64 qw(encode_base64); + + my $nutrec = $DB->get('nut') || $DB->new_record('nut', {type => 'service'}); + my $master_pw = $nutrec->prop('MasterPass'); + if (not $master_pw) + { + $master_pw = "not set due to error"; + if ( open( RANDOM, "/dev/urandom" ) ) + { + my $buf; + if ( read( RANDOM, $buf, 57 ) != 57 ) + { + warn("Short read from /dev/random: $!"); + } + else + { + $master_pw = encode_base64($buf); + chomp $master_pw; + } + close RANDOM; + } + else + { + warn "Could not open /dev/urandom: $!"; + } + $nutrec->set_prop('MasterPass', $master_pw); + } + if (not $slave_pw) + { + $slave_pw = "not set due to error"; + if ( open( RANDOM, "/dev/urandom" ) ) + { + my $buf; + if ( read( RANDOM, $buf, 57 ) != 57 ) + { + warn("Short read from /dev/random: $!"); + } + else + { + $slave_pw = encode_base64($buf); + chomp $slave_pw; + } + close RANDOM; + } + else + { + warn "Could not open /dev/urandom: $!"; + } + $nutrec->set_prop('SlavePass', $slave_pw); + } +} diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE 2002-11-18 15:56:32.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/DEVICE 1969-12-31 17:00:00.000000000 -0700 @@ -1,5 +0,0 @@ -{ -# UPS device - needed if UPS is locally attached - my $device = $nut{Device} || "/var/lib/ups/hiddev0"; - $OUT .= "DEVICE=$device"; -} diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL 2006-03-15 12:51:21.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/MODEL 2006-12-21 12:26:19.000000000 -0700 @@ -1,15 +1 @@ -{ -# Model of the UPS (filename to call for it, without path) -# Example - one of -# apcsmart - APC SMartUPS and similar -# fentonups - Fenton UPS -# optiups -# bestups -# genericups -# ups-trust425+625 -# You MUST change this, or set SERVER to "no" - my $model = $nut{Model} || "newhidups"; - - $OUT .= "MODEL=$model"; -} - +MODEL=upsdrvctl diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS 2002-11-18 15:56:32.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/OPTIONS 1969-12-31 17:00:00.000000000 -0700 @@ -1,8 +0,0 @@ -{ -# Any options to pass to $MODEL -# ex. for my TrippLite UPS, use -# OPTIONS="-t 5" - my $options = $nut{Options} || ''; - $OUT .= "OPTIONS=$options"; -} - diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER 2002-11-18 15:56:32.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/sysconfig/ups/SERVER 2006-12-21 12:26:46.000000000 -0700 @@ -1,3 +1 @@ -{# If the UPS is locally attached set it to "yes" -}SERVER=yes - +SERVER=yes diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL 2002-11-18 15:56:32.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/20ACL 2006-12-21 12:44:48.000000000 -0700 @@ -1,2 +1,3 @@ ACL all 0.0.0.0/0 ACL localhost 127.0.0.1/32 +ACL localnet { "$InternalInterface{Network}/$InternalInterface{Netmask}" } diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS 2006-03-15 12:51:21.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.conf/40ACCESS 2006-12-21 12:44:57.000000000 -0700 @@ -1,2 +1,3 @@ ACCEPT localhost +ACCEPT localnet REJECT all diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor 2002-11-19 14:05:50.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsd.users/monitor 2006-12-21 13:00:59.000000000 -0700 @@ -1,5 +1,10 @@ - [monuser] - password = mypassword + [upsmaster] + password = { $nut{MasterPass} } allowfrom = localhost + upsmon master + + [upsslave] + password = { $nut{SlavePass} } + allowfrom = localhost localnet upsmon slave diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR 2006-03-15 12:51:21.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/MONITOR 2006-12-21 13:01:32.000000000 -0700 @@ -1 +1 @@ -MONITOR UPS@localhost 1 monuser mypassword slave +MONITOR UPS@localhost 1 upsmaster { $nut{MasterPass} } master diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG 2006-03-15 12:51:21.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/NOTIFYMSG 1969-12-31 17:00:00.000000000 -0700 @@ -1 +0,0 @@ -# NOTIFYMSG is set to default diff -Nur -x '*.orig' -x '*.rej' e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER --- e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER 2006-03-15 12:51:21.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/templates/etc/ups/upsmon.conf/RUN_AS_USER 1969-12-31 17:00:00.000000000 -0700 @@ -1 +0,0 @@ -# RUN_AS_USER nutmon