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