File tree Expand file tree Collapse file tree 5 files changed +26
-31
lines changed Expand file tree Collapse file tree 5 files changed +26
-31
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,11 @@ Requires: coreutils
1717Recommends: gzip
1818%endif
1919
20- # we require selinux-policy package version that matches or exceeds our build system version
21- # this guarantees that our compiled selinux policy will work.
20+ # We add a recommends for the selinux-policy package version that matches or exceeds our build system version.
21+ # This increases the likelihood that our compiled selinux policy will work.
22+ # By making this a weak dependency we allow the package to install on systems with an older selinux-policy version.
2223%if %{?rhel}%{!?rhel:0} >= 8
23- Requires : selinux-policy >= @@SELINUX_POLICY_VERSION@@
24+ Recommends : selinux-policy >= @@SELINUX_POLICY_VERSION@@
2425%endif
2526
2627AutoReqProv: no
147148%prefix/selinux/cfengine-enterprise.pp
148149%prefix/selinux/cfengine-enterprise.te
149150%prefix/selinux/cfengine-enterprise.fc
151+ %prefix/selinux/label-binaries-unconfined.sh
150152%endif
151153
152154# Globally installed configs, scripts
Original file line number Diff line number Diff line change @@ -25,12 +25,14 @@ Recommends: gzip
2525Requires(pre): /usr/sbin/useradd, /usr/sbin/userdel, /usr/bin/getent
2626Requires(post): /usr/sbin/usermod, /bin/sed
2727
28- # we require selinux-policy package version that matches or exceeds our build system version
29- # this guarantees that our compiled selinux policy will work.
28+ # We add a recommends for the selinux-policy package version that matches or exceeds our build system version.
29+ # This increases the likelihood that our compiled selinux policy will work.
30+ # By making this a weak dependency we allow the package to install on systems with an older selinux-policy version.
3031%if %{?rhel}%{!?rhel:0} >= 8
31- Requires : selinux-policy >= @@SELINUX_POLICY_VERSION@@
32+ Recommends : selinux-policy >= @@SELINUX_POLICY_VERSION@@
3233%endif
3334
35+
3436# we don't bundle OpenSSL on RHEL 8 (and newer in the future)
3537%if %{?rhel}%{!?rhel:0} == 8
3638Requires: libssl.so.1.1()(64bit) libssl.so.1.1(OPENSSL_1_1_0)(64bit) libssl.so.1.1(OPENSSL_1_1_1)(64bit)
@@ -413,6 +415,7 @@ exit 0
413415%prefix/selinux/cfengine-enterprise.pp
414416%prefix/selinux/cfengine-enterprise.te
415417%prefix/selinux/cfengine-enterprise.fc
418+ %prefix/selinux/label-binaries-unconfined.sh
416419%endif
417420
418421# Documentation
Original file line number Diff line number Diff line change @@ -17,10 +17,11 @@ Requires: coreutils
1717Recommends: gzip
1818%endif
1919
20- # we require selinux-policy package version that matches or exceeds our build system version
21- # this guarantees that our compiled selinux policy will work.
20+ # We add a recommends for the selinux-policy package version that matches or exceeds our build system version.
21+ # This increases the likelihood that our compiled selinux policy will work.
22+ # By making this a weak dependency we allow the package to install on systems with an older selinux-policy version.
2223%if %{?rhel}%{!?rhel:0} >= 8
23- Requires : selinux-policy >= @@SELINUX_POLICY_VERSION@@
24+ Recommends : selinux-policy >= @@SELINUX_POLICY_VERSION@@
2425%endif
2526
2627# we don't bundle OpenSSL on RHEL 8 (and newer in the future)
@@ -173,6 +174,7 @@ exit 0
173174%prefix/selinux/cfengine-enterprise.pp
174175%prefix/selinux/cfengine-enterprise.te
175176%prefix/selinux/cfengine-enterprise.fc
177+ %prefix/selinux/label-binaries-unconfined.sh
176178%endif
177179
178180# Globally installed configs, scripts
Original file line number Diff line number Diff line change 1111 test -x /usr/sbin/restorecon || cf_console echo " warning! selinuxenabled exists and returns 0 but restorecon not found"
1212 fi
1313 if ! cf_console semodule -n -i " $PREFIX /selinux/cfengine-enterprise.pp" ; then
14- cf_console echo " warning! semodule import failed, examine /var/log/CFE*log and \
15- consider installing selinux-policy-devel package and \
16- rebuilding policy with: \
17- \
18- cd $PREFIX /selinux \
19- make -f /usr/share/selinux/devel/Makefile -j1 \
20- semodule -n -i $PREFIX /selinux/cfengine-enterprise.pp \
21- \
22- and then restarting services with \
23- \
24- systemctl restart cfengine3"
14+ cf_console echo " warning! semodule import failed, as a fallback all binaries in $PREFIX will be labeled bin_t aka unconfined. \
15+ The semodule import failure should be examined in /var/log/CFE*log and reported so that properly confined CFEngine can be setup."
16+ if ! " $PREFIX " /share/selinux/label-binaries-unconfined.sh " $PREFIX " ; then
17+ cf_console echo " warning! fallback to label all binaries unconfined has failed. CFEngine may not properly operate with selinux set to enforcing."
18+ fi
2519 fi
2620 if /usr/sbin/selinuxenabled; then
2721 /usr/sbin/load_policy
Original file line number Diff line number Diff line change @@ -127,17 +127,11 @@ then
127127
128128 fi
129129 if ! cf_console semodule -n -i " $PREFIX /selinux/cfengine-enterprise.pp" ; then
130- cf_console echo " warning! semodule import failed, examine /var/log/CFE*log and \
131- consider installing selinux-policy-devel package and \
132- rebuilding policy with: \
133- \
134- cd $PREFIX /selinux \
135- make -f /usr/share/selinux/devel/Makefile -j1 \
136- semodule -n -i $PREFIX /selinux/cfengine-enterprise.pp \
137- \
138- and then restarting services with \
139- \
140- systemctl restart cfengine3"
130+ cf_console echo " warning! semodule import failed, as a fallback all binaries in $PREFIX will be labeled bin_t aka unconfined. \
131+ The semodule import failure should be examined in /var/log/CFE*log and reported so that properly confined CFEngine can be setup."
132+ if ! " $PREFIX " /share/selinux/label-binaries-unconfined.sh " $PREFIX " ; then
133+ cf_console echo " warning! fallback to label all binaries unconfined has failed. CFEngine may not properly operate with selinux set to enforcing."
134+ fi
141135 fi
142136 if /usr/sbin/selinuxenabled; then
143137 /usr/sbin/load_policy
You can’t perform that action at this time.
0 commit comments