Bug 427098 - newrole without tty
Summary: newrole without tty
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: policycoreutils
Version: 5.0
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-12-31 15:41 UTC by Timothy Reed
Modified: 2008-09-09 17:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-09 17:40:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to policycoreutils-1.34.11 (19.13 KB, patch)
2007-12-31 15:41 UTC, Timothy Reed
no flags Details | Diff

Description Timothy Reed 2007-12-31 15:41:43 UTC
Description of problem:  Need the ability to run newrole outside of a tty
(background).

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


How reproducible: 
Try to run a command from newrole in a background script

Steps to Reproduce:
1. Create two shell scripts, (foo1.sh, foo2.sh)
2. Have foo1.sh call foo2.sh and put into the background
3. In foo2.sh call newrole and pass it  -- -c <command>
4. Verify that newrole says "Error! Could not retrieve tty information."

foo1.sh
-----
#!/bin/bash
./foo2.sh &

foo2.sh
#!/bin/bash
newrole -l SystemHigh -- -c ls /tmp
  
Actual results:
Error! Could not retrieve tty information

Expected results:
Newrole should run

Additional info:

Comment 1 Timothy Reed 2007-12-31 15:41:43 UTC
Created attachment 290579 [details]
Patch to policycoreutils-1.34.11

Comment 2 Daniel Walsh 2007-12-31 15:59:20 UTC
Can't you do this with runcon?

Comment 3 Timothy Reed 2007-12-31 20:08:39 UTC
Yes but I also need polyinstantiation of the tmp directory

Comment 4 Daniel Walsh 2007-12-31 20:23:49 UTC
My concern on modifying newrole, it it is only allowed to happen on a secure
terminal, for LSPP.  So if you try to newrole on a pseudo terminal it will fail.
 Chainging this to not require a terminal might break lSPP.

Comment 5 Stephen Smalley 2008-01-07 14:35:37 UTC
The issue for LSPP was that newrole relabels the tty/pty, and in the case of a
pty, this only relabels the slave end of the pty, not the master end, leaving
open a channel that can be used to downgrade information in violation of MLS
policy.  Thus, LSPP added a check to newrole to restrict what types of ttys can
be used for level changes, and the LSPP configuration limited it to ttys rather
than ptys.

If there is no tty/pty with this patch, then newrole doesn't relabel anything,
and thus no new channels are introduced that didn't already exist.

So I don't see a problem here.


Comment 6 Daniel Walsh 2008-01-08 18:30:20 UTC
Tim can you submit this upstream and get approval there,  Then we can consider
back porting.

Comment 7 RHEL Program Management 2008-01-21 15:55:46 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 RHEL Program Management 2008-06-04 22:47:11 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 10 Daniel Walsh 2008-09-09 17:40:26 UTC
This fix is in U2 policy.


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