Skip to content

Commit d1682f3

Browse files
committed
Added fallback selinux script to label binaries as unconfined in case the cfengine-enterprise module fails to install
In case the normal cfengine-enterprise policy module fails to install the scripts will run this new scripts to ensure that CFEngine can function even if SELinux is enforcing by labeling them as bin_t aka unconfined. Ticket: ENT-12980 Changelog: title
1 parent acd5705 commit d1682f3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

misc/selinux/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ selinuxdir = $(prefix)/selinux
99
selinux_DATA = cfengine-enterprise.pp
1010
selinux_DATA += cfengine-enterprise.te
1111
selinux_DATA += cfengine-enterprise.fc
12+
selinux_DATA += label-binaries-unconfined.sh
1213

1314
clean-local:
1415
rm -rf tmp
@@ -18,5 +19,6 @@ endif
1819
# tarball even without running './configure --with-selinux-policy'
1920
DISTFILES = Makefile.in Makefile.am cfengine-enterprise.fc cfengine-enterprise.te.all
2021
DISTFILES += cfengine-enterprise.te.el9
22+
DISTFILES += label-binaries-unconfined.sh
2123

2224
CLEANFILES = cfengine-enterprise.pp cfengine-enterprise.if cfengine-enterprise.te
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# This script is intended to be used by the package scriptlets in case the selinux module fails to install
3+
_prefix=${1:-/var/cfengine}
4+
find "$_prefix" -type f -executable | while IFS='' read -r binary
5+
do
6+
semanage -a -t bin_t "$binary"
7+
done

0 commit comments

Comments
 (0)