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