Bug 218880

Summary: LSPP: 'more' doesn't work after a newrole
Product: Red Hat Enterprise Linux 5 Reporter: Linda Knippers <linda.knippers>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: iboverma, sdsmall, sgrubb
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RC Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-02-08 01:33:05 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 Linda Knippers 2006-12-07 23:08:30 UTC
Description of problem:
After using 'newrole' to change roles on an MLS system, the 'more'
command no longer works.  It gets an EBADF when trying to read the
user's input for paging.  The problem is that 'more' reads stderr
but 'newrole' closes stderr and re-opens it as WRONLY.

Should we make 'newrole' less paranoid with respect to stderr or
fix 'more'?  'less' reads stdin and therefore works.

Version-Release number of selected component (if applicable):
RHEL5 Beta 2 with MLS policy and policycoreutils from dwalsh
people page.

How reproducible:
very

Steps to Reproduce:
1.install an mls system
2.log in
3.run 'more' on a file bigger than a screen full (works)
4.run 'newrole' to change roles, or probably anything else
5.run 'more' again on the same file and it will terminate after
the first screen full.  An strace shows its an EBADF and I've
verified that the newrole code closes and reopens the fd.

  
Actual results:
'more' aborts after the first screen full.

Expected results:
'more' should wait for user input and then page through the file according.

Additional info:

Comment 1 Stephen Smalley 2006-12-08 13:54:29 UTC
Recommend reverting newrole to opening all three descriptors rw, as it used to
do before it was "cleaned up".  This seems consistent with how the shell sets up
descriptors for the tty as well.
Should be a trivial patch, please take to selinux list.

Comment 4 Daniel Walsh 2006-12-08 16:56:09 UTC
Fixed in policycoreutils-1.33.6-4.el5

Comment 5 Linda Knippers 2006-12-08 20:06:30 UTC
When this shows up in a repo or a kit I'll give it a try.
Are you also posting a patch to the selinux list?

Comment 6 Jay Turner 2006-12-14 13:16:25 UTC
QE ack for RHEL5.

Comment 7 RHEL Program Management 2007-02-08 01:33:05 UTC
A package has been built which should help the problem described in 
this bug report. This report is therefore being closed with a resolution 
of CURRENTRELEASE. You may reopen this bug report if the solution does 
not work for you.