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