17b94a
From eb37a3b57415d2d4206ecdd2db10530366a0d1b1 Mon Sep 17 00:00:00 2001
17b94a
From: Anoop C S <anoopcs@redhat.com>
17b94a
Date: Fri, 13 Dec 2019 15:20:27 +0530
17b94a
Subject: [PATCH 342/344] Revert "hooks: remove selinux hooks"
17b94a
17b94a
This reverts commit 421743b7cfa6a249544f6abb4cca5a612bd20ea1.
17b94a
17b94a
Note:- We are not bringing back features.selinux but just the hooks for
17b94a
       setting SELinux context on bricks
17b94a
17b94a
Label: DOWNSTREAM ONLY
17b94a
17b94a
Change-Id: Iccc10428361cac59b294e1d7aa1ba8187c20029e
17b94a
BUG: 1686800
17b94a
Signed-off-by: Anoop C S <anoopcs@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/187691
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Niels de Vos <ndevos@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 configure.ac                                | 4 ++++
17b94a
 extras/hook-scripts/Makefile.am             | 2 +-
17b94a
 extras/hook-scripts/create/Makefile.am      | 1 +
17b94a
 extras/hook-scripts/create/post/Makefile.am | 6 ++++++
17b94a
 extras/hook-scripts/delete/Makefile.am      | 1 +
17b94a
 extras/hook-scripts/delete/pre/Makefile.am  | 6 ++++++
17b94a
 glusterfs.spec.in                           | 2 ++
17b94a
 7 files changed, 21 insertions(+), 1 deletion(-)
17b94a
 create mode 100644 extras/hook-scripts/create/Makefile.am
17b94a
 create mode 100644 extras/hook-scripts/create/post/Makefile.am
17b94a
 create mode 100644 extras/hook-scripts/delete/Makefile.am
17b94a
 create mode 100644 extras/hook-scripts/delete/pre/Makefile.am
17b94a
17b94a
diff --git a/configure.ac b/configure.ac
17b94a
index 327733e..98ee311 100644
17b94a
--- a/configure.ac
17b94a
+++ b/configure.ac
17b94a
@@ -221,6 +221,10 @@ AC_CONFIG_FILES([Makefile
17b94a
                 extras/hook-scripts/add-brick/Makefile
17b94a
                 extras/hook-scripts/add-brick/pre/Makefile
17b94a
                 extras/hook-scripts/add-brick/post/Makefile
17b94a
+                extras/hook-scripts/create/Makefile
17b94a
+                extras/hook-scripts/create/post/Makefile
17b94a
+                extras/hook-scripts/delete/Makefile
17b94a
+                extras/hook-scripts/delete/pre/Makefile
17b94a
                 extras/hook-scripts/start/Makefile
17b94a
                 extras/hook-scripts/start/post/Makefile
17b94a
                 extras/hook-scripts/set/Makefile
17b94a
diff --git a/extras/hook-scripts/Makefile.am b/extras/hook-scripts/Makefile.am
17b94a
index 771b37e..26059d7 100644
17b94a
--- a/extras/hook-scripts/Makefile.am
17b94a
+++ b/extras/hook-scripts/Makefile.am
17b94a
@@ -1,5 +1,5 @@
17b94a
 EXTRA_DIST = S40ufo-stop.py S56glusterd-geo-rep-create-post.sh
17b94a
-SUBDIRS = add-brick set start stop reset
17b94a
+SUBDIRS = add-brick create delete set start stop reset
17b94a
 
17b94a
 scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/gsync-create/post/
17b94a
 if USE_GEOREP
17b94a
diff --git a/extras/hook-scripts/create/Makefile.am b/extras/hook-scripts/create/Makefile.am
17b94a
new file mode 100644
17b94a
index 0000000..b083a91
17b94a
--- /dev/null
17b94a
+++ b/extras/hook-scripts/create/Makefile.am
17b94a
@@ -0,0 +1 @@
17b94a
+SUBDIRS = post
17b94a
diff --git a/extras/hook-scripts/create/post/Makefile.am b/extras/hook-scripts/create/post/Makefile.am
17b94a
new file mode 100644
17b94a
index 0000000..919801a
17b94a
--- /dev/null
17b94a
+++ b/extras/hook-scripts/create/post/Makefile.am
17b94a
@@ -0,0 +1,6 @@
17b94a
+EXTRA_DIST = S10selinux-label-brick.sh
17b94a
+
17b94a
+scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/create/post/
17b94a
+if WITH_SERVER
17b94a
+scripts_SCRIPTS = S10selinux-label-brick.sh
17b94a
+endif
17b94a
diff --git a/extras/hook-scripts/delete/Makefile.am b/extras/hook-scripts/delete/Makefile.am
17b94a
new file mode 100644
17b94a
index 0000000..c98a05d
17b94a
--- /dev/null
17b94a
+++ b/extras/hook-scripts/delete/Makefile.am
17b94a
@@ -0,0 +1 @@
17b94a
+SUBDIRS = pre
17b94a
diff --git a/extras/hook-scripts/delete/pre/Makefile.am b/extras/hook-scripts/delete/pre/Makefile.am
17b94a
new file mode 100644
17b94a
index 0000000..93a6b85
17b94a
--- /dev/null
17b94a
+++ b/extras/hook-scripts/delete/pre/Makefile.am
17b94a
@@ -0,0 +1,6 @@
17b94a
+EXTRA_DIST = S10selinux-del-fcontext.sh
17b94a
+
17b94a
+scriptsdir = $(GLUSTERD_WORKDIR)/hooks/1/delete/pre/
17b94a
+if WITH_SERVER
17b94a
+scripts_SCRIPTS = S10selinux-del-fcontext.sh
17b94a
+endif
17b94a
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
17b94a
index 1b975b2..012989a 100644
17b94a
--- a/glusterfs.spec.in
17b94a
+++ b/glusterfs.spec.in
17b94a
@@ -1453,6 +1453,7 @@ exit 0
17b94a
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/add-brick/pre/S28Quota-enable-root-xattr-heal.sh
17b94a
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create
17b94a
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/post
17b94a
+            %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/post/S10selinux-label-brick.sh
17b94a
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/create/pre
17b94a
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/copy-file
17b94a
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/copy-file/post
17b94a
@@ -1461,6 +1462,7 @@ exit 0
17b94a
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/post
17b94a
                             %{_sharedstatedir}/glusterd/hooks/1/delete/post/S57glusterfind-delete-post
17b94a
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/pre
17b94a
+            %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/delete/pre/S10selinux-del-fcontext.sh
17b94a
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick
17b94a
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/post
17b94a
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/remove-brick/pre
17b94a
-- 
17b94a
1.8.3.1
17b94a