rpm: Require policycoreutils >= 3.10 for policydb version 24 support#451
rpm: Require policycoreutils >= 3.10 for policydb version 24 support#451lsm5 wants to merge 1 commit intocontainers:mainfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds conditional RPM post-install dependency on policycoreutils >= 3.10 for Fedora and RHEL 10+, while preserving a looser dependency for RHEL 9 and earlier via a new macro, to ensure support for policydb module version 24 in the container-selinux %post script. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
The container-selinux %post script uses semodule to install policy modules. On CentOS Stream 10 / RHEL 10, the HLL/PP converter in policycoreutils < 3.10 doesn't support policydb module version 24, causing installation failures: ``` libsepol.policydb_read: policydb module version 24 does not match my version range 4-23 ``` policycoreutils 3.10 added support for version 24. This change adds a conditional requirement using the `old_policydb` macro for RHEL 9 and earlier, while RHEL 10+ and Fedora require >= 3.10. Resolves: RHEL-151636 Signed-off-by: Lokesh Mandvekar <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces conditional logic to define old_policydb for RHEL 9 and older, which adjusts the policycoreutils dependency version. Feedback indicates that the current implementation will cause installation failures on Fedora because it lacks the old_policydb definition while having a policycoreutils version lower than 3.10. It is suggested to refine the conditional logic to include Fedora and to double-check the version string '3.10'.
| %if %{defined rhel} && 0%{?rhel} <= 9 | ||
| %define old_policydb 1 | ||
| %endif |
There was a problem hiding this comment.
The logic for defining old_policydb currently excludes Fedora and generic distributions, forcing them to require policycoreutils >= 3.10. Since current Fedora releases (like F40 and F41) ship with versions 3.6 or 3.7, this requirement will cause installation failures on those platforms.
Additionally, please verify if 3.10 is the intended version string. In RPM versioning, 3.10 is significantly higher than 3.7. If you intended to reference version 3.1 with a specific release (e.g., 3.1-10), the current string will not match as expected. Consider aligning this block with the no_user_namespace logic above to include generic distributions, and verify the impact on Fedora.
%if %{!defined fedora} && %{!defined rhel} || %{defined rhel} && 0%{?rhel} <= 9
%define old_policydb 1
%endif
The container-selinux %post script uses semodule to install policy modules. On CentOS Stream 10 / RHEL 10, the HLL/PP converter in policycoreutils < 3.10 doesn't support policydb module version 24, causing installation failures:
policycoreutils 3.10 added support for version 24. This change adds a conditional requirement using the
old_policydbmacro for RHEL 9 and earlier, while RHEL 10+ and Fedora require >= 3.10.Resolves: RHEL-151636
Summary by Sourcery
Adjust container-selinux packaging requirements to ensure compatibility with newer SELinux policy module versions on RHEL and Fedora.
Bug Fixes:
Enhancements:
Build: