Bug 447403

Summary: selinux utilities report incorrect context for /var/lib/iscsi* objects
Product: Red Hat Enterprise Linux 5 Reporter: Milan Zázrivec <mzazrivec>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-20 21:31:55 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:
Bug Depends On:    
Bug Blocks: 445005    

Description Milan Zázrivec 2008-05-19 19:56:34 UTC
Description of problem:
matchpathcon reports incorrect context for /var/lib/iscsi or /var/lock/iscsi

Version-Release number of selected component (if applicable):
libselinux-1.33.4-5.el5
selinux-policy-2.4.6-137.el5

How reproducible:
Always

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
  
Actual results:
# matchpathcon /var/lock/iscsi /var/lib/iscsi/
/var/lock/iscsi system_u:object_r:var_lock_t:s0
/var/lib/iscsi/ system_u:object_r:var_lib_t:s0
# 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

Comment 1 Daniel Walsh 2008-05-20 00:28:01 UTC
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.

Comment 2 Milan Zázrivec 2008-05-20 06:32:54 UTC
I'm guessing libselinux is a wrong component then ...

Comment 3 Daniel Walsh 2008-05-20 15:34:29 UTC
Yes, fixed.

Comment 4 Daniel Walsh 2008-05-22 18:52:18 UTC
Fixed in selinux-policy-2.4.6-138.el5 

Comment 5 RHEL Program Management 2008-06-02 19:58:34 UTC
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
release.

Comment 9 errata-xmlrpc 2009-01-20 21:31:55 UTC
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.

http://rhn.redhat.com/errata/RHBA-2009-0163.html