Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
We discovered issue in bug #1569466, which uses this macro. If selinux-policy-targeted is not (yet) installed, it would emit tracebacks from semanage. Because that fail happens inside for, any failures are not reported to rpm. It just emits errors to stderr and would not set the variable.
Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-166.el7.noarch
How reproducible:
always
Steps to Reproduce:
1. yum remove selinux-policy-targeted
2. yum install bind
3.
Actual results:
Traceback (most recent call last):
File "/usr/sbin/semanage", line 32, in <module>
import seobject
File "/usr/lib64/python2.7/site-packages/seobject/__init__.py", line 36, in <module>
import sepolicy
File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 930, in <module>
raise e
ValueError: No SELinux Policy installed
Traceback (most recent call last):
File "/usr/sbin/semanage", line 32, in <module>
import seobject
File "/usr/lib64/python2.7/site-packages/seobject/__init__.py", line 36, in <module>
import sepolicy
File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 930, in <module>
raise e
ValueError: No SELinux Policy installed
Traceback (most recent call last):
File "/usr/sbin/semanage", line 32, in <module>
import seobject
File "/usr/lib64/python2.7/site-packages/seobject/__init__.py", line 36, in <module>
import sepolicy
File "/usr/lib64/python2.7/site-packages/sepolicy/__init__.py", line 930, in <module>
raise e
ValueError: No SELinux Policy installed
Expected results:
Additional info:
Second problem with this macro was found. It relies on text output, but that output is locale dependent. When testing it in 1minutetip with different locale, I found it is not set back to original value on uninstallation. It has different output and output does not contain on and off.
# cat /etc/selinux/targeted/rpmbooleans.custom
# This file is managed by macros.selinux-policy. Do not edit it manually
boolean -m --named_write_master_zones (vypnout,vypnout) Allow named to write master zones named_write_master_zones
That comes from LANG=cs_CZ.UTF-8
I am not sure if it is feature. But number of sets has to match number of unsets called. In our case, it would not reset correctly to previous boolean state. Because I require on set in posttrans and post on upgrade. Is such behaviour required?
I think bug #1609323 is related to this one too. But the macro should not be guarded on selinuxenabled property. I think it would need default state ability, so it reset to default value. Now it is impossible to get back to default value if that was changed over time. It will always return to original value, not default value specified by current policy. It would be required to sometime remove boolean enable macro from bind.
Could you check also bug #1647659 ? Is there way to store boolean when selinux is disabled? When it is reenabled, would it load value set last time? I assume selinuxenabled should be changed only on reboots, unline setenforce? Is that right?
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2019:2127