Red Hat Bugzilla – Bug 447403
selinux utilities report incorrect context for /var/lib/iscsi* objects
Last modified: 2015-09-29 05:20:04 EDT
Description of problem:
matchpathcon reports incorrect context for /var/lib/iscsi or /var/lock/iscsi
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install RHEL5.2, iscsi-initiator-utils included, selinux enabled
2. # matchpathcon /var/lock/iscsi /var/lib/iscsi/
3. # grep iscsi /etc/selinux/targeted/contexts/files/file_contexts
# matchpathcon /var/lock/iscsi /var/lib/iscsi/
# grep iscsi /etc/selinux/targeted/contexts/files/file_contexts
/var/lib/iscsi(/.*)? -- system_u:object_r:iscsi_var_lib_t:s0
/var/run/iscsid.pid -- system_u:object_r:iscsi_var_run_t:s0
/var/lock/iscsi(/.*)? -- system_u:object_r:iscsi_lock_t:s0
/sbin/iscsid -- system_u:object_r:iscsid_exec_t:s0
Well in truth matchpathcon is reporting the correct context.
The file context you are showing, has -- which tells matchpathcon to only match
on files not directories.
The real fix is to remove the -- to make it match on any file type.
I'm guessing libselinux is a wrong component then ...
Fixed in selinux-policy-2.4.6-138.el5
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.