Bug 542420

Summary: selinux sticks ":etc_t:" into symlinks labels in /etc/cron.xxxx directories
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.6.32-120.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-07 22:47:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Jaegermann 2009-11-29 18:42:01 UTC
Description of problem:

I have scripts in /usr/local/sbin/ and the have labels like root:object_r:bin_t:SystemLow.  If I will put a symlink pointin to such script into, say, /etc/cron.daily or /etc/cron.hourly than that symlink ends up
with root:object_r:etc_t:SystemLow while other executables there have labels
system_u:object_r:bin_t:SystemLow.  The net effect is that later I see in /var/log/cron

Could not set exec or key create context to system_u:system_r:system_cronjob_t:SystemLow:SystemLow-SystemHigh for user

If I make a copy of hardlink files then lablels end up as system_u:object_r:bin_t:SystemLow, i.e. as anything else.

Version-Release number of selected component (if applicable):
selinux-policy-3.6.32-46.fc12

Additional info:
This a new behaviour as I was hit by it after upgrading Fedora 10 to Fedora 12 which promptly broke my existing scripts even if I was running previously with enforcing selinux too.

Comment 1 Michal Jaegermann 2009-11-30 18:04:15 UTC
OTOH see bug 426428.  Boggle!

Comment 2 Daniel Walsh 2009-11-30 19:42:19 UTC
I am changing the labeling so all files in that directory will be bin_t, not just regular files.

Current labeling is 
/etc/cron.daily/.*		--	gen_context(system_u:object_r:bin_t,s0)

Which says label all files as bin_t

New labeling says

/etc/cron.daily(/.*)?			gen_context(system_u:object_r:bin_t,s0)

Which should set all of the labels to bin_t.

You can set this your self doing

# semanage fcontext -a -t bin_t '/etc/cron.daily(/.*)?'
# restorecon -R -v /etc/cron.daily
Fixed in selinux-policy-3.6.32-52.fc12.noarch

Comment 3 Fedora Update System 2009-12-01 16:53:55 UTC
selinux-policy-3.6.32-52.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-52.fc12

Comment 4 Fedora Update System 2009-12-03 05:01:17 UTC
selinux-policy-3.6.32-52.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12549

Comment 5 Fedora Update System 2009-12-03 20:25:57 UTC
selinux-policy-3.6.32-55.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-55.fc12

Comment 6 Fedora Update System 2009-12-04 23:44:04 UTC
selinux-policy-3.6.32-55.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12650

Comment 7 Fedora Update System 2009-12-08 07:50:41 UTC
selinux-policy-3.6.32-55.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2010-08-05 13:17:07 UTC
selinux-policy-3.6.32-120.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/selinux-policy-3.6.32-120.fc12

Comment 9 Fedora Update System 2010-08-20 01:37:37 UTC
selinux-policy-3.6.32-120.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.