/[smecontribs]/rpms/smeserver-bugzilla/contribs8/smeserver-bugzilla-0.1-strong-pwd.patch
ViewVC logotype

Contents of /rpms/smeserver-bugzilla/contribs8/smeserver-bugzilla-0.1-strong-pwd.patch

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


Revision 1.1 - (show annotations) (download)
Tue Feb 12 04:03:29 2013 UTC (11 years, 8 months ago) by unnilennium
Branch: MAIN
CVS Tags: smeserver-bugzilla-1_0-2_el5_sme, smeserver-bugzilla-1_0-3_el5_sme, smeserver-bugzilla-0_1-5_el5_sme, HEAD
Error occurred while calculating annotation data.
Initial import

1 diff -up smeserver-bugzilla-0.1/root/etc/e-smith/db/configuration/migrate/80bugzilla.strong-pwd smeserver-bugzilla-0.1/root/etc/e-smith/db/configuration/migrate/80bugzilla
2 --- smeserver-bugzilla-0.1/root/etc/e-smith/db/configuration/migrate/80bugzilla.strong-pwd 2010-03-05 18:24:27.000000000 +0100
3 +++ smeserver-bugzilla-0.1/root/etc/e-smith/db/configuration/migrate/80bugzilla 2010-03-05 18:54:17.000000000 +0100
4 @@ -1,9 +1,9 @@
5 {
6 use MIME::Base64 qw(encode_base64);
7
8 - my $service;
9 - my $rec;
10 - my $pw;
11 + my $service;
12 + my $rec;
13 + my $pw;
14
15 # Enable InnoDB (needed for Bugzilla)
16 $service = 'mysqld';
17 @@ -19,5 +19,27 @@
18 $pw = $rec->prop('DbPassword');
19 return "" if $pw;
20
21 - $rec->set_prop('DbPassword', sprintf("%.15s", MIME::Base64::encode(int( (1000000000000000) * rand() ))));
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 +
43 + $rec->set_prop('DbPassword', $pw);
44 +
45 }

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