initial commit of file from CVS for smeserver-egroupware on Sat Sep 7 20:22:36 AEST 2024
This commit is contained in:
1
root/etc/e-smith/db/accounts/defaults/egroupware/type
Normal file
1
root/etc/e-smith/db/accounts/defaults/egroupware/type
Normal file
@@ -0,0 +1 @@
|
||||
reserved
|
@@ -0,0 +1 @@
|
||||
egroupware
|
@@ -0,0 +1 @@
|
||||
egwuser
|
@@ -0,0 +1 @@
|
||||
on
|
@@ -0,0 +1 @@
|
||||
eGroupWare
|
@@ -0,0 +1 @@
|
||||
global
|
@@ -0,0 +1 @@
|
||||
url
|
35
root/etc/e-smith/db/configuration/migrate/85egroupware
Normal file
35
root/etc/e-smith/db/configuration/migrate/85egroupware
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
my $rec = $DB->get('egroupware')
|
||||
|| $DB->new_record('egroupware', {type => 'service'});
|
||||
|
||||
my $pw = $rec->prop('DbPassword');
|
||||
|
||||
return "" if $pw;
|
||||
if (not $pw or length($pw) < 25)
|
||||
{
|
||||
use MIME::Base64 qw(encode_base64);
|
||||
|
||||
$pw = "not set due to error";
|
||||
|
||||
if ( open( RANDOM, "/dev/urandom" ) )
|
||||
{
|
||||
my $buf;
|
||||
if ( read( RANDOM, $buf, 25 ) != 25 )
|
||||
{
|
||||
warn("Short read from /dev/random: $!");
|
||||
}
|
||||
else
|
||||
{
|
||||
$pw = encode_base64($buf);
|
||||
chomp $pw;
|
||||
}
|
||||
close RANDOM;
|
||||
}
|
||||
else
|
||||
{
|
||||
warn "Could not open /dev/urandom: $!";
|
||||
}
|
||||
|
||||
$rec->set_prop('DbPassword', $pw);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user