Skip to content

Commit d357e20

Browse files
author
Till Brehm
committed
Merge branch 'master' into 'master'
Master See merge request ispconfig/ispconfig3!671
2 parents c759aa0 + 90eb2ee commit d357e20

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

install/lib/installer_base.lib.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,15 +497,22 @@ public function grant_master_database_rights($verbose = false) {
497497

498498
//* insert the ispconfig user in the remote server
499499
$from_host = $conf['hostname'];
500-
$from_ip = gethostbyname($conf['hostname']);
501500

502501
$hosts[$from_host]['user'] = $conf['mysql']['master_ispconfig_user'];
503502
$hosts[$from_host]['db'] = $conf['mysql']['master_database'];
504503
$hosts[$from_host]['pwd'] = $conf['mysql']['master_ispconfig_password'];
505504

506-
$hosts[$from_ip]['user'] = $conf['mysql']['master_ispconfig_user'];
507-
$hosts[$from_ip]['db'] = $conf['mysql']['master_database'];
508-
$hosts[$from_ip]['pwd'] = $conf['mysql']['master_ispconfig_password'];
505+
$ip_list=array();
506+
$ip_rec=dns_get_record($conf['hostname'], DNS_A + DNS_AAAA);
507+
if(!empty($ip_rec)) foreach($ip_rec as $rec => $ip) $ip_list[]=@(isset($ip['ip']))?$ip['ip']:$ip['ipv6'];
508+
509+
if(!empty($ip_list)) {
510+
foreach($ip_list as $ip) {
511+
$hosts[$ip]['user'] = $conf['mysql']['master_ispconfig_user'];
512+
$hosts[$ip]['db'] = $conf['mysql']['master_database'];
513+
$hosts[$ip]['pwd'] = $conf['mysql']['master_ispconfig_password'];
514+
}
515+
}
509516
} else{
510517
/*
511518
* it is NOT a master-slave - Setup so we have to find out all clients and their

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,21 @@ function write_dkim_key($key_file, $key_value, $key_domain) {
196196
$public_key='';
197197
foreach($pubkey as $values) $public_key=$public_key.$values."\n";
198198
/* save the DKIM Public-key in dkim-dir */
199-
if ( $app->system->file_put_contents($key_file.'.public', $public_key) )
199+
if ( $app->system->file_put_contents($key_file.'.public', $public_key) ) {
200200
$app->log('Saved DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
201+
if($app->system->is_user('amavis')) {
202+
$amavis_user='amavis';
203+
} elseif ($app->system->is_user('vscan')) {
204+
$amavis_user='vscan';
205+
}
206+
else {
207+
$amavis_user='';
208+
}
209+
if($amavis_user!='') {
210+
$app->system->chown($key_file.'.private', $amavis_user);
211+
$app->system->chmod($key_file.'.private', 0440);
212+
}
213+
}
201214
else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
202215
} else {
203216
$app->log('Unable to save DKIM Private-key to '.$key_file.'.private', LOGLEVEL_ERROR);

0 commit comments

Comments
 (0)