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 1145758 - makewhatis.lock mislabeled
Summary: makewhatis.lock mislabeled
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: man
Version: 6.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Nikola Forró
QA Contact: Jakub Heger
URL:
Whiteboard:
Depends On:
Blocks: 1159820
TreeView+ depends on / blocked
 
Reported: 2014-09-23 16:26 UTC by Martin Žember
Modified: 2017-03-21 10:04 UTC (History)
8 users (show)

Fixed In Version: man-1.6f-34.el6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-21 10:04:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0645 0 normal SHIPPED_LIVE man bug fix update 2017-03-21 12:32:05 UTC

Description Martin Žember 2014-09-23 16:26:14 UTC
Description of problem:
Mislabeled file '/var/lock/makewhatis.lock' found. Labeled as 'system_u:object_r:system_cronjob_lock_t:s0', should be 'system_u:object_r:var_lock_t:s0'.

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

How reproducible:
Always

Steps to Reproduce:
1. Run /etc/cron.daily/makewhatis.cron
2. ls -Z /var/lock/makewhatis.lock

Actual results:
system_u:object_r:system_cronjob_lock_t:s0

Expected results:
system_u:object_r:var_lock_t:s0

Additional info:

Comment 1 Martin Žember 2014-10-01 10:03:06 UTC
Milos suggests running restorecon after touch.

But we have to change the policy accordingly. If the file has a correct label and the 'unconfined' module is disabled, then it will be impossible to remove the lock file.

# sesearch -s system_cronjob_t -t system_cronjob_lock_t -c file -p unlink -A -C
Found 2 semantic av rules:
   allow files_unconfined_type file_type : file { ioctl read write create getattr setattr lock relabelfrom relabelto append unlink link rename execute swapon quotaon mounton execute_no_trans entrypoint open } ; 
   allow system_cronjob_t system_cronjob_lock_t : file { ioctl read write create getattr setattr lock append unlink link rename open } ; 

# sesearch -s system_cronjob_t -t var_lock_t -c file -p unlink -A -C
Found 1 semantic av rules:
   allow files_unconfined_type file_type : file { ioctl read write create getattr setattr lock relabelfrom relabelto append unlink link rename execute swapon quotaon mounton execute_no_trans entrypoint open } ; 

# rpm -qa selinux\*
selinux-policy-3.7.19-260.el6.noarch
selinux-policy-minimum-3.7.19-260.el6.noarch
selinux-policy-doc-3.7.19-260.el6.noarch
selinux-policy-targeted-3.7.19-260.el6.noarch
selinux-policy-mls-3.7.19-260.el6.noarch

Comment 2 Jan Chaloupka 2014-10-01 10:30:16 UTC
This is only selinux issue, right? There is only "touch Makefile" and "touch /var/cache/man/whatis. No touch for makewhatis.cron.

Only:
install -m755 %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/makewhatis.cron

This looks to me as a cron bug, not man one. What do you think?

Comment 3 Milos Malik 2014-10-01 10:34:42 UTC
# grep LOCKFILE /etc/cron.daily/makewhatis.cron 
LOCKFILE=/var/lock/makewhatis.lock
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
touch $LOCKFILE
#

Comment 4 Martin Žember 2014-10-02 16:39:40 UTC
...which means that a proper way to fix /etc/cron.daily/makewhatis.cron is:

touch $LOCKFILE; restorecon $LOCKFILE

The other part of the issue is in the selinux policy. But they know what to do.

There was a needinfo on me so I answered with this summary.

Comment 6 Miroslav Grepl 2014-11-05 07:23:22 UTC
Ok, This is probably also SELinux bug. We have

matchpathcon /var/lock/makewhatis.lock
/var/lock/makewhatis.lock	<<none>>

on RHEL7 but we have

[mgrepl@rhel6 ~]$ matchpathcon /var/lock/makewhatis.lock
/var/lock/makewhatis.lock	system_u:object_r:var_lock_t:s0

on RHEL6. It makes sense to don't have a default label for lock files created on the fly.

Comment 15 errata-xmlrpc 2017-03-21 10:04:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0645.html


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