Bug 169850 - /etc/profile.d/selinux.sh wrongly redirects stderr
/etc/profile.d/selinux.sh wrongly redirects stderr
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: selinux-policy-strict (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-04 09:40 EDT by Russell Coker
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-03 14:10:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Russell Coker 2005-10-04 09:40:19 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.2 (like Gecko)

Description of problem:
The script /etc/profile.d/selinux.sh tries to parse stderr output when it is 
only capable of parsing stdout.  For example when the file_contexts file has 
duplicate entries the script gives the following output: 
 
Restoring SELinux context for: 
same 
same 
same 
same 
/sbin/restorecon:  error while labeling files under same 
/sbin/restorecon:  error while labeling files under same 
/sbin/restorecon:  error while labeling files under same 
/sbin/restorecon:  error while labeling files under same 
 
 
Which makes no sense.  I removed the "2>&1" from the restorecon command line 
and the following results were displayed: 
/etc/selinux/strict/contexts/files/file_contexts: Multiple same specifications 
for /usr/local/whatever. 
/etc/selinux/strict/contexts/files/file_contexts: Multiple same specifications 
for /home/whatever. 
/etc/selinux/strict/contexts/files/file_contexts: Multiple same specifications 
for /etc/whatever. 
/etc/selinux/strict/contexts/files/file_contexts: Multiple same specifications 
for /etc/whatever. 
 
The latter is a lot easier to understand. 

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

How reproducible:
Always

Steps to Reproduce:
Have an error in the file_contexts file and login. 

Additional info:
Comment 1 Daniel Walsh 2005-11-03 14:10:03 EST
Fixed in rawhide.

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