Bug 767568 - restorecon -vF reports changes for unchanged contexts
Summary: restorecon -vF reports changes for unchanged contexts
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: policycoreutils
Version: 5.8
Hardware: All
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-14 11:29 UTC by Karel Volný
Modified: 2013-03-19 15:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-19 15:18:41 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Karel Volný 2011-12-14 11:29:28 UTC
Description of problem:
Running "restorecon -vF" reports files whose contexts stay unchanged.

Version-Release number of selected component (if applicable):
policycoreutils-1.33.12-14.8.el5

How reproducible:
always

Steps to Reproduce:
1. cd ~
2. touch restorecontest
3. ls -lZ restorecontest 
4. restorecon -vF restorecontest 
5. ls -lZ restorecontest 
  
Actual results:
3. -rw-r--r--  root root root:object_r:user_home_t        restorecontest
4. restorecon reset /root/restorecontest context root:object_r:user_home_t:s0->root:object_r:user_home_t:s0
5. -rw-r--r--  root root root:object_r:user_home_t        restorecontest

Expected results:
3. -rw-r--r--  root root root:object_r:user_home_t        restorecontest
4. (no output)
5. -rw-r--r--  root root root:object_r:user_home_t        restorecontest


Additional info:
you see that restorecon hasn't changed the contexts of the file, the listing says the same in 3. and 5., and from the man page:

       -v     show changes in file labels.
       -F     Force reset of context to match file_context for customizable files, or the user section, if it has changed.


- so the -F option should not touch the file as "if it has changed" doesn't apply, and in addition the -v option should not list the file as there are no changes to show

Comment 1 RHEL Program Management 2011-12-14 11:37:21 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 2 Daniel Walsh 2011-12-14 15:02:20 UTC
I don't see this happening on RHEL6.  But I am not sure it is worth fixing in RHEL5.

Comment 3 Miroslav Grepl 2013-03-19 15:18:41 UTC
It is fixed in RHEL6 so I am closing bug as NEXTRELEASE.


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