233933
From 916a79ea78db264ceedd4ebdba794e488b82eceb Mon Sep 17 00:00:00 2001
233933
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
233933
Date: Wed, 21 Jun 2017 10:01:20 -0400
233933
Subject: [PATCH 069/124] common-ha: enable and disable selinux
233933
 ganesha_use_fusefs
233933
233933
Starting in Fedora 26 and RHEL 7.4 there are new targeted policies
233933
in selinux which include a tuneable to allow ganesha.nfsd to access
233933
the gluster (FUSE) shared_storage volume where ganesha maintains its
233933
state.
233933
233933
N.B. rpm doesn't have a way to distinguish between RHEL 7.3 or 7.4
233933
so it can't be enabled for RHEL at this time. /usr/sbin/semanage is
233933
in policycoreutils-python in RHEL (versus policycoreutils-python-utils
233933
in Fedora.) Once RHEL 7.4 GAs we may also wish to specify the version
233933
for RHEL 7 explicitly, i.e.
233933
  Requires: selinux-policy >= 3.13.1-160.
233933
But beware, the corresponding version in Fedora 26 seems to be
233933
selinux-policy-3.13.1.258 or so. (Maybe earlier versions, but that's
233933
what's currently in the F26 beta.
233933
233933
release-3.10 is the upstream master branch for glusterfs-ganesha. For
233933
release-3.11 and later storhaug needs a similar change, which is
233933
tracked by https://github.com/linux-ha-storage/storhaug/issues/11
233933
233933
Maybe at some point we would want to consider migrating the targeted
233933
policies for glusterfs (and nfs-ganesha) from selinux-policy to a
233933
glusterfs-selinux (and nfs-ganesha-selinux) subpackage?
233933
233933
Label: DOWNSTREAM ONLY
233933
233933
Change-Id: I04a5443edd00636cbded59a2baddfa98095bf7ac
233933
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
233933
Reviewed-on: https://review.gluster.org/17597
233933
Smoke: Gluster Build System <jenkins@build.gluster.org>
233933
Reviewed-by: Niels de Vos <ndevos@redhat.com>
233933
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
233933
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
233933
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/167154
233933
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 glusterfs.spec.in | 21 +++++++++++++++++++++
233933
 1 file changed, 21 insertions(+)
233933
233933
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
233933
index d748ebc..b01c94f 100644
233933
--- a/glusterfs.spec.in
233933
+++ b/glusterfs.spec.in
233933
@@ -466,6 +466,11 @@ Requires:         pcs, dbus
233933
 Requires:         cman, pacemaker, corosync
233933
 %endif
233933
 
233933
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
233933
+Requires(post):   policycoreutils-python-utils
233933
+Requires(postun): policycoreutils-python-utils
233933
+%endif
233933
+
233933
 %description ganesha
233933
 GlusterFS is a distributed file-system capable of scaling to several
233933
 petabytes. It aggregates various storage bricks over Infiniband RDMA
233933
@@ -923,6 +928,14 @@ exit 0
233933
 %systemd_post glustereventsd
233933
 %endif
233933
 
233933
+%if ( 0%{!?_without_server:1} )
233933
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
233933
+%post ganesha
233933
+semanage boolean -m ganesha_use_fusefs --on
233933
+exit 0
233933
+%endif
233933
+%endif
233933
+
233933
 %if ( 0%{!?_without_georeplication:1} )
233933
 %post geo-replication
233933
 if [ $1 -ge 1 ]; then
233933
@@ -1055,6 +1068,14 @@ fi
233933
 exit 0
233933
 %endif
233933
 
233933
+%if ( 0%{!?_without_server:1} )
233933
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
233933
+%postun ganesha
233933
+semanage boolean -m ganesha_use_fusefs --off
233933
+exit 0
233933
+%endif
233933
+%endif
233933
+
233933
 ##-----------------------------------------------------------------------------
233933
 ## All %%files should be placed here and keep them grouped
233933
 ##
233933
-- 
233933
1.8.3.1
233933