/[smecontribs]/rpms/smeserver-zabbix-server/contribs9/smeserver-zabbix-server-0.1-mysql_db_pass.patch
ViewVC logotype

Annotation of /rpms/smeserver-zabbix-server/contribs9/smeserver-zabbix-server-0.1-mysql_db_pass.patch

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


Revision 1.1 - (hide annotations) (download)
Tue Feb 9 23:11:13 2016 UTC (8 years, 9 months ago) by stephdl
Branch: MAIN
CVS Tags: smeserver-zabbix-server-0_1-18_el6_sme, smeserver-zabbix-server-0_1-17_el6_sme, smeserver-zabbix-server-0_1-16_el6_sme, smeserver-zabbix-server-0_1-15_el6_sme, smeserver-zabbix-server-0_1-19_el6_sme, smeserver-zabbix-server-0_1-14_el6_sme, HEAD
* Wed Feb 7 2016 stephane de Labrusse <stephdl@de-labrusse.fr> 0.1-14.sme
- New roll for sme9

1 stephdl 1.1 diff -Nur -x '*.orig' -x '*.rej' smeserver-zabbix-server-0.1/root/etc/e-smith/db/configuration/migrate/zabbix-server-database mezzanine_patched_smeserver-zabbix-server-0.1/root/etc/e-smith/db/configuration/migrate/zabbix-server-database
2     --- smeserver-zabbix-server-0.1/root/etc/e-smith/db/configuration/migrate/zabbix-server-database 2009-02-02 21:01:58.000000000 +0100
3     +++ mezzanine_patched_smeserver-zabbix-server-0.1/root/etc/e-smith/db/configuration/migrate/zabbix-server-database 2009-02-11 09:40:44.000000000 +0100
4     @@ -1,11 +1,33 @@
5     {
6     - use MIME::Base64 qw(encode_base64);
7     + my $rec = $DB->get('zabbix-server')
8     + || $DB->new_record('zabbix-server', {type => 'service'});
9     + my $pw = $rec->prop('DbPassword');
10     + if (not $pw or length($pw) < 57)
11     + {
12     + use MIME::Base64 qw(encode_base64);
13    
14     - my $rec = $DB->get('zabbix-server') || $DB->new_record('zabbix-server', {type => 'service'});
15     -
16     - my $pw = $rec->prop('DbPassword');
17     - return "" if $pw;
18     -
19     - $rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() )));
20     -}
21     + $pw = "not set due to error";
22     + if ( open( RANDOM, "/dev/urandom" ) )
23     + {
24     + my $buf;
25     + # 57 bytes is a full line of Base64 coding, and contains
26     + # 456 bits of randomness - given a perfectly random /dev/random
27     + if ( read( RANDOM, $buf, 57 ) != 57 )
28     + {
29     + warn("Short read from /dev/random: $!");
30     + }
31     + else
32     + {
33     + $pw = encode_base64($buf);
34     + chomp $pw;
35     + }
36     + close RANDOM;
37     + }
38     + else
39     + {
40     + warn "Could not open /dev/urandom: $!";
41     + }
42     + $rec->set_prop('DbPassword', $pw);
43     + }
44     +}
45    

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