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.

Bug 1427335

Summary: [extras-rhel-7.3.4] container selinux policy not removed after rpm package remove
Product: Red Hat Enterprise Linux 7 Reporter: Qian Cai <qcai>
Component: container-selinuxAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED ERRATA QA Contact: Martin Jenner <mjenner>
Severity: high Docs Contact:
Priority: high    
Version: 7.3CC: dwalsh, li.longjiang, lsu
Target Milestone: rcKeywords: Extras, Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: container-selinux-2.12-2.gite7096ce.el7_3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-26 14:55:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Qian Cai 2017-02-27 23:04:04 UTC
Description of problem:
# rpm -e container-selinux

# semodule -lfull | grep container
200 container         pp

Version-Release number of selected component (if applicable):
container-selinux-2.9-4.el7

How reproducible:
always

Additional info:
We might want to fix in the next release.

Comment 5 Lokesh Mandvekar 2017-05-09 14:08:56 UTC
Dan, any idea on this one? 

%postun already has semodule -n -r container docker &> /dev/null || :

which if I'm reading correctly, should remove the module.

Also, if I manually try to remove the container module, I see this:

$ sudo semodule -r container
libsemanage.semanage_direct_remove_key: Unable to remove module container at priority 400. (No such file or directory).
semodule:  Failed!

Comment 6 Qian Cai 2017-05-09 14:17:45 UTC
IMO, you want to remove the policy at the priority 200, i.e., semodule -r container -X 200

Comment 7 Lokesh Mandvekar 2017-05-09 14:22:07 UTC
tried that too

$ sudo semodule -r container -X 200
libsemanage.semanage_direct_remove_key: Unable to remove module container at priority 400. (No such file or directory).

$ sudo semodule -lfull | grep container
200 container         pp

Comment 8 Qian Cai 2017-05-09 14:24:57 UTC
I am sorry, but semodule seems dumb. It needs,

# semodule -X 200 -r container

Comment 9 Lokesh Mandvekar 2017-05-09 14:38:01 UTC
that works. thanks, I'll include this in a follow-up build

Comment 11 Daniel Walsh 2017-05-09 15:02:41 UTC
I prefer to think of it as Optionally challenged.

This LGTM

Comment 12 Luwen Su 2017-05-15 09:55:13 UTC
Works fine now,

#rpm -e container-selinux docker-2:1.12.6-26.git62520c0.el7.x86_64 docker-logrotate-2:1.12.6-26.git62520c0.el7.x86_64 docker-lvm-plugin-2:1.12.6-26.git62520c0.el7.x86_64 docker-novolume-plugin-2:1.12.6-26.git62520c0.el7.x86_64

Move to verified.

Comment 14 errata-xmlrpc 2017-05-26 14:55:43 UTC
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-2017:1331

Comment 15 li.longjiang 2021-03-10 03:55:24 UTC
container-selinux-2.119.2-1.911c772.el7_8.noarch still has the problem, why?