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