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