Bug 427098 - newrole without tty
newrole without tty
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: policycoreutils (Show other bugs)
5.0
All Linux
low Severity low
: rc
: ---
Assigned To: Daniel Walsh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-12-31 10:41 EST by Timothy Reed
Modified: 2008-09-09 13:40 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-09 13:40:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Timothy Reed 2007-12-31 10:41:43 EST
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 10:41:43 EST
Created attachment 290579 [details]
Patch to policycoreutils-1.34.11
Comment 2 Daniel Walsh 2007-12-31 10:59:20 EST
Can't you do this with runcon?
Comment 3 Timothy Reed 2007-12-31 15:08:39 EST
Yes but I also need polyinstantiation of the tmp directory
Comment 4 Daniel Walsh 2007-12-31 15:23:49 EST
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 09:35:37 EST
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 13:30:20 EST
Tim can you submit this upstream and get approval there,  Then we can consider
back porting.
Comment 7 RHEL Product and Program Management 2008-01-21 10:55:46 EST
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 Product and Program Management 2008-06-04 18:47:11 EDT
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 13:40:26 EDT
This fix is in U2 policy.

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