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