Bug 812675 - File contexts are processed in the order they were added
File contexts are processed in the order they were added
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: policycoreutils (Show other bugs)
19
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-15 17:12 EDT by Christoph Wickert
Modified: 2015-01-14 08:15 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-14 08:15:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Christoph Wickert 2012-04-15 17:12:08 EDT
Description of problem:
File contexts are processed in the order they were added.

Version-Release number of selected component (if applicable):
policycoreutils-2.1.11-5.fc17.x86_64

How reproducible:
always

Steps to Reproduce:
# semanage fcontext -a -t virt_image_t "/home/libvirt/images(/.*)?"
# semanage fcontext -a -t virt_var_lib_t "/home/libvirt(/.*)?"
# matchpathcon /home/libvirt/images/test
/home/libvirt/images/test system_u:object_r:virt_var_lib_t:s0

That’s not what we want, so we set the context for /home/libvirt/images again:

# semanage fcontext -a -t virt_image_t "/home/libvirt/images(/.*)?"
# matchpathcon /home/libvirt/images/test
/home/libvirt/images/test system_u:object_r:virt_var_lib_t:s0

Nothing has changed. Let’s start over again:

# semanage fcontext -d "/home/libvirt/images(/.*)?"
# semanage fcontext -d "/home/libvirt(/.*)?"
# semanage fcontext -a -t virt_var_lib_t "/home/libvirt(/.*)?"
# semanage fcontext -a -t virt_image_t "/home/libvirt/images(/.*)?"
# matchpathcon /home/libvirt/images/test
/home/libvirt/images/test system_u:object_r:virt_image_t:s0
  
Actual results:
Obviously order does matter and one has to remove contexts to set them again in the right order. That doesn’t scale. Imagine you have to remove contexts all the way up to your root directory...

Expected results:
I would expect something like “specific overwrites general” but definitely not “last come, first served”.

Additional info:
Please bear with me for filing this here and feel free to move the bug upstream as required. I was told to file it here in #selinux.
Comment 1 Fedora End Of Life 2013-04-03 10:43:12 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Comment 2 Fedora End Of Life 2015-01-09 12:07:12 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Note You need to log in before you can comment on or make changes to this bug.