Skip to content

Commit 2fb6123

Browse files
committed
Adjusted RPM packaging to be avoid failed installs when selinux-policy version is not sufficient
As a workaround, if the cfengine-enterprise selinux module fails to install we set binaries to unconfined domain with bin_t type. Ticket: ENT-12980 Changelog: title We have found that this requirement cannot be met in the field so we are investigating other ways to ensure the latest SELinux policy can be put in place during install. Ticket: ENT-12980 Changelog: title
1 parent e97e00d commit 2fb6123

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

packaging/cfengine-community/cfengine-community.spec.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ Requires: coreutils
1717
Recommends: 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
AutoReqProv: no
@@ -147,6 +148,7 @@ done
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

packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ Recommends: gzip
2525
Requires(pre): /usr/sbin/useradd, /usr/sbin/userdel, /usr/bin/getent
2626
Requires(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
3638
Requires: 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

packaging/cfengine-nova/cfengine-nova.spec.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ Requires: coreutils
1717
Recommends: 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

0 commit comments

Comments
 (0)