Bug 542933

Summary: restorecon -i does not ignore files that do not exist
Product: [Fedora] Fedora Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: dwalsh, mgrepl
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-01 07:44:17 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:

Description Jan Pazdziora (Red Hat) 2009-12-01 09:38:32 UTC
Description of problem:

In rpm scriptlets, I rely on restorecon -i not giving error when file that I try to restorecon does not exist. On Fedora 12, this feature is broken, restorecon prints error message and returns 255.

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

# rpm -qf /sbin/restorecon
policycoreutils-2.0.74-17.fc12.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Make sure /var/log/xxx does not exist.
2. Run # restorecon -rvi /var/log/xxx ; echo $?
  
Actual results:

# restorecon -rvi /var/log/xxx ; echo $?
restorecon:  lstat(/var/log/xxx) failed:  No such file or directory
255

Expected results:

# restorecon -rvi /var/log/xxx ; echo $?0
0

This is what I get with policycoreutils-1.33.12-14.6.el5 and policycoreutils-2.0.62-12.14.fc11.i586.

Additional info:

Comment 1 Jan Pazdziora (Red Hat) 2010-02-01 07:44:17 UTC
Ths issue seems to be fixed with

# rpm -qf /sbin/restorecon
policycoreutils-2.0.78-10.fc12.i686

Comment 2 Jan Pazdziora (Red Hat) 2010-02-01 07:44:43 UTC
This issue seems to be fixed with

# rpm -qf /sbin/restorecon
policycoreutils-2.0.78-10.fc12.i686