Bug 1294301

Summary: SELinux local (new) customisations lost after selinux-policy-targeted update
Product: [Fedora] Fedora Reporter: Tibbs Brookside <9dnmlarl>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 23CC: dominick.grift, dwalsh, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-04 13:48:03 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 Tibbs Brookside 2015-12-26 17:19:55 UTC
Description of problem:
SELinux context entries for local (new) files and directories are lost following updates to the selinux-policy-targeted package.

For example, if I add a new entry as follows:

semanage fcontext -a -t httpd_sys_content_t "/data/www(/.*)?"
restorecon -R -v /data/www/

As far as I understand, these local (new) customisations get stored in:
/etc/selinux/targeted/contexts/files/file_contexts.local

but this file gets replaced when the selinux-policy-targeted package is updated, and so all my customisations get lost:

rpm -qf /etc/selinux/targeted/contexts/files/file_contexts.local
selinux-policy-targeted-3.13.1-158.fc23.noarch

Should the package replace this file, or reinstate the contents as part of the update (as appears to be done for the /etc/selinux/targeted/contexts/files/file_contexts file)?

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.13.1-158.fc23.noarch

Comment 1 Lukas Vrabec 2016-01-04 13:48:03 UTC
This should work *from* selinux-policy-targeted-3.13.1-158.fc23.noarch to selinux-policy-targeted-3.13.1-159.fc23.noarch and higher package update.

*** This bug has been marked as a duplicate of bug 1291601 ***