From 00952a0b9a210c8df93e1b03f0f508c6087a16f9 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 17 Mar 2013 01:23:21 +0100 Subject: fix selttype on EL6 --- manifests/centos.pp | 6 +++++- manifests/defaultphpdirs.pp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/centos.pp b/manifests/centos.pp index 69f11ab..caf46ce 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -32,13 +32,17 @@ class apache::centos inherits apache::package { Selinux::Fcontext{ before => File[web_dir], } + $seltype_rw = $::lsbmajdistrelease ? { + 5 => 'httpd_sys_script_rw_t', + default => 'httpd_sys_rw_content_t' + } selinux::fcontext{ [ '/var/www/vhosts/[^/]*/www(/.*)?', '/var/www/vhosts/[^/]*/non_public(/.*)?', '/var/www/vhosts/[^/]*/g2data(/.*)?', '/var/www/vhosts/[^/]*/upload(/.*)?' ]: require => Package['apache'], - setype => 'httpd_sys_script_rw_t'; + setype => $seltype_rw; '/var/www/vhosts/[^/]*/logs(/.*)?': require => Package['apache'], setype => 'httpd_log_t'; diff --git a/manifests/defaultphpdirs.pp b/manifests/defaultphpdirs.pp index 16561ac..5485241 100644 --- a/manifests/defaultphpdirs.pp +++ b/manifests/defaultphpdirs.pp @@ -16,11 +16,15 @@ class apache::defaultphpdirs { } if $::selinux != 'false' { + $seltype_rw = $::lsbmajdistrelease ? { + 5 => 'httpd_sys_script_rw_t', + default => 'httpd_sys_rw_content_t' + } selinux::fcontext{ [ '/var/www/upload_tmp_dir/.+(/.*)?', '/var/www/session.save_path/.+(/.*)?' ]: require => Package['apache'], - setype => 'httpd_sys_script_rw_t', + setype => $seltype_rw, before => File['/var/www/upload_tmp_dir','/var/www/session.save_path']; } } -- cgit v1.2.3