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 2007-01-18 08:48:45.000000000 -0700 +++ mezzanine_patched_e-smith-nutUPS-1.2.0/root/etc/e-smith/db/configuration/migrate/nutPass 2007-01-18 08:48:27.000000000 -0700 @@ -2,51 +2,6 @@ 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); - } + $nutrec->set_prop('MasterPass', sprintf("%15.0f", int( (1000000000000000) * rand() ))) if not $nutrec->prop('MasterPass'); + $nutrec->set_prop('SlavePass', sprintf("%15.0f", int( (1000000000000000) * rand() ))) if not $nutrec->prop('SlavePass'); }