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 876241 - Anacron comes from a broken HOME
Summary: Anacron comes from a broken HOME
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: cronie
Version: 6.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Marcela Mašláňová
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 878032 962842
TreeView+ depends on / blocked
 
Reported: 2012-11-13 16:03 UTC by Ted Rule
Modified: 2013-05-14 14:45 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 878032 962842 (view as bug list)
Environment:
Last Closed: 2013-05-14 14:45:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ted Rule 2012-11-13 16:03:01 UTC
Description of problem:

This is a variant of the problem already reported in Bugzilla 575419 where /etc/crontab incorrectly set HOME=/ such that the cron.daily Job was unable to make use of root-specific configuration files such as /root/.my.cnf

Because of the reworking of Cron/Anacron under RHEL6, cron.daily's environment is now effectively controlled by /etc/cron.d/0hourly which also has a HOME-/ setting. 

Our recommendation is to comment out HOME=/ from BOTH /etc/crontab and /etc/cron.d/0hourly in RHEL6 and /etc/crontab in RHEL5.


Version-Release number of selected component (if applicable):

cronie-1.4.4-7.el6.i686


How reproducible:

Create a cron.daily Job which reports HOME - by simply executing /bin/env for instance.


Additional info:

In the course of trying to debug this problem, we found two additional problems when trying to read /root/.my.cnf from within a /etc/logrotate.d/mysql script within logrotate within cron.daily.

The first problem is that /etc/cron.daily/logrotate erroneously - in our view - redirects STDOUT and STDERR to /dev/null under RHEL6, whereas it redirects into cron.daily's sendmail PIPE under RHEL5. Surely this NULLing should be removed?

The second problem is that under RHEL6, /root/* has an SELinux Label of admin_home_t whereas it had a Label of user_home_t under RHEL5. The side-effect is that logrotate_t has no read permissions to /root/* under RHEL6, even though it did under RHEL5. Consequently we added this permission to get our particular logrotate script working:

allow logrotate_t admin_home_t:dir { list_dir_perms };
allow logrotate_t admin_home_t:file { read_file_perms };

Is it reasonable to add this permission to RHEL6?

Comment 2 Marcela Mašláňová 2012-11-19 13:50:23 UTC
Hi,
thank for your very thorough report. I'll look at settings of HOME at least for the upstream project.
I'll clone other bugs to their components.

Thanks,
Marcela

Comment 3 Marcela Mašláňová 2013-05-14 14:45:35 UTC
I would prefer to fix it in upstream project and fix it in next release.


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