sasl: Fix running saslauthd as non root on CentOS 7.
This commit is contained in:
parent
5b177cbaaf
commit
23b3afacc9
1 changed files with 31 additions and 4 deletions
|
@ -138,11 +138,38 @@ class sasl::saslauthd {
|
|||
group => $user,
|
||||
before => Service["saslauthd"],
|
||||
}
|
||||
if versioncmp($::operatingsystemrelease, "7") < 0 {
|
||||
augeas { "set-saslauthd-user":
|
||||
context => "/files/etc/sysconfig/saslauthd",
|
||||
changes => "set DAEMONOPTS '\"--user ${user}\"'",
|
||||
notify => Service["saslauthd"],
|
||||
}
|
||||
} else {
|
||||
file { "/etc/systemd/system/saslauthd.service.d":
|
||||
ensure => directory,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
require => Class["sasl::client"],
|
||||
}
|
||||
file { "/etc/systemd/system/saslauthd.service.d/user.conf":
|
||||
ensure => present,
|
||||
content => "[Service]\nUser=${user}\n",
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
require => File["/etc/systemd/system/saslauthd.service.d"],
|
||||
notify => Service["saslauthd"],
|
||||
}
|
||||
file { "/usr/lib/tmpfiles.d/saslauthd.conf":
|
||||
ensure => present,
|
||||
content => "d /run/saslauthd 0775 root ${user} -\n",
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
require => Class["sasl::client"],
|
||||
}
|
||||
}
|
||||
}
|
||||
default: {
|
||||
fail("Running saslauthd as non root not supported on ${::operatingsystem}")
|
||||
|
|
Loading…
Add table
Reference in a new issue