Blob Blame History Raw
From dbd45cb5fcce0a3378f6ecd0c14b578e6f843e3d Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Fri, 24 Jul 2020 16:03:20 +0200
Subject: [PATCH 1/2] nfsserver: fix SELinux issue due to newer ls versions
 giving additional output.

This patch has been tested on RHEL6, 7 and 8.
---
 heartbeat/nfsserver | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
index 0dbc173f3..80d20676b 100755
--- a/heartbeat/nfsserver
+++ b/heartbeat/nfsserver
@@ -192,7 +192,7 @@ fi
 which restorecon > /dev/null 2>&1 && selinuxenabled
 SELINUX_ENABLED=$?
 if [ $SELINUX_ENABLED -eq 0 ]; then
-	export SELINUX_LABEL="$(ls -ldZ $STATD_PATH | cut -f4 -d' ')"
+	export SELINUX_LABEL="$(ls -dZ $STATD_PATH | grep -o '\S\+:\S\+:\S\+')"
 fi
 
 ##

From 81118dbb25fe2cfc7d5fc803178cd7c3b445915e Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Mon, 27 Jul 2020 10:33:44 +0200
Subject: [PATCH 2/2] nfsnotify: fix SELinux issue due to newer ls versions
 giving additional output.

---
 heartbeat/nfsnotify.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/heartbeat/nfsnotify.in b/heartbeat/nfsnotify.in
index 7f710bca7..851f6ad6b 100644
--- a/heartbeat/nfsnotify.in
+++ b/heartbeat/nfsnotify.in
@@ -305,7 +305,7 @@ esac
 which restorecon > /dev/null 2>&1 && selinuxenabled
 SELINUX_ENABLED=$?
 if [ $SELINUX_ENABLED -eq 0 ]; then
-	export SELINUX_LABEL="$(ls -ldZ $STATD_PATH | cut -f4 -d' ')"
+	export SELINUX_LABEL="$(ls -dZ $STATD_PATH | grep -o '\S\+:\S\+:\S\+')"
 fi
 
 case $__OCF_ACTION in