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