Bug 812675 - File contexts are processed in the order they were added
Summary: File contexts are processed in the order they were added
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-15 21:12 UTC by Christoph Wickert
Modified: 2015-01-14 13:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-14 13:15:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Christoph Wickert 2012-04-15 21:12:08 UTC
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 14:43:12 UTC
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 17:07:12 UTC
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.