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