Skip to content

Commit f496e92

Browse files
author
Till Brehm
committed
Fix for amavisd config permissions on CentOS 7.2
1 parent 775ed6c commit f496e92

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

install/dist/lib/centos_base.lib.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class installer_centos extends installer_dist {
3333
protected $clamav_socket = '/tmp/clamd.socket';
3434

3535
public function configure_amavis() {
36-
global $conf;
36+
global $conf, $dist;
3737

3838
// amavisd user config file
3939
$configfile = 'fedora_amavisd_conf';
@@ -50,6 +50,12 @@ public function configure_amavis() {
5050
$content = str_replace('/var/spool/amavisd/clamd.sock', $this->clamav_socket, $content);
5151
wf($conf["amavis"]["config_dir"].'/amavisd.conf', $content);
5252
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
53+
54+
// for CentOS 7.2 only
55+
if($dist['confid'] == 'centos72') {
56+
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750);
57+
chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis');
58+
}
5359

5460

5561
// Adding the amavisd commands to the postfix configuration

install/dist/lib/fedora.lib.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public function configure_dovecot()
480480
}
481481

482482
public function configure_amavis() {
483-
global $conf;
483+
global $conf, $dist;
484484

485485
// amavisd user config file
486486
$configfile = 'fedora_amavisd_conf';
@@ -497,8 +497,7 @@ public function configure_amavis() {
497497
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0640);
498498

499499
// for CentOS 7.2 only
500-
$distname = get_distname();
501-
if($distname['confid'] == 'centos72') {
500+
if($dist['confid'] == 'centos72') {
502501
chmod($conf['amavis']['config_dir'].'/amavisd.conf', 0750);
503502
chgrp($conf['amavis']['config_dir'].'/amavisd.conf', 'amavis');
504503
}

0 commit comments

Comments
 (0)