Bug 216055 - LSPP: newrole doesn't preserve shell exit status
LSPP: newrole doesn't preserve shell exit status
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: policycoreutils (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-16 19:04 EST by Amy Griffis
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version: RC
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-02-07 19:32:17 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)
patch (655 bytes, patch)
2006-11-16 19:04 EST, Amy Griffis
no flags Details | Diff

  None (edit)
Description Amy Griffis 2006-11-16 19:04:17 EST
Description of problem:

When newrole exits, it doesn't preserve the exit status from the shell. It
always returns 0 (or -1 for an error in newrole).

It should return the exit status of the child unless there is an error in newrole.

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


How reproducible:


Steps to Reproduce:
1. newrole -r 
2. exit 42
3. echo $?
  
Actual results:
0

Expected results:
42

Additional info:
I attached a patch for newrole.c which will fix this.
Comment 1 Amy Griffis 2006-11-16 19:04:17 EST
Created attachment 141427 [details]
patch
Comment 2 Daniel Walsh 2006-11-28 10:15:57 EST
Fixed in policycoreutils-1.33.4-2.el5
Comment 3 Jay Turner 2007-01-10 22:38:35 EST
QE ack for RHEL5.
Comment 4 RHEL Product and Program Management 2007-02-07 19:32:17 EST
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.

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