Skip to content

Commit

Permalink
Fixes #30962 - fix dhcpd.conf acl
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bucher committed Oct 7, 2020
1 parent 3838f92 commit 131a9af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions manifests/proxydhcp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
exec { "Allow ${foreman_proxy::user} to read ${path}":
command => "setfacl -R -m u:${foreman_proxy::user}:rx ${path}",
path => ['/bin', '/usr/bin'],
unless => "getfacl -p ${path} | grep user:${foreman_proxy::user}:r-x",
require => Package['acl'],
require => [
Package['acl'],
Class['dhcp'],
],
}
}

Expand Down
6 changes: 2 additions & 4 deletions spec/classes/foreman_proxy__proxydhcp__spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
case facts[:osfamily]
when 'RedHat', 'Debian'
it do should contain_exec('Allow foreman-proxy to read /etc/dhcp').
with_command('setfacl -R -m u:foreman-proxy:rx /etc/dhcp').
with_unless('getfacl -p /etc/dhcp | grep user:foreman-proxy:r-x')
with_command('setfacl -R -m u:foreman-proxy:rx /etc/dhcp')
end
else
it { should_not contain_exec('Allow foreman-proxy to read /etc/dhcp') }
Expand All @@ -89,8 +88,7 @@
case facts[:osfamily]
when 'RedHat', 'Debian'
it do should contain_exec("Allow foreman-proxy to read #{leases_dir}").
with_command("setfacl -R -m u:foreman-proxy:rx #{leases_dir}").
with_unless("getfacl -p #{leases_dir} | grep user:foreman-proxy:r-x")
with_command("setfacl -R -m u:foreman-proxy:rx #{leases_dir}")
end
else
it { should_not contain_exec("Allow foreman-proxy to read #{leases_dir}") }
Expand Down

0 comments on commit 131a9af

Please sign in to comment.