Bug 11029 - su does not return the error code to invoking shell
su does not return the error code to invoking shell
Product: Red Hat Linux
Classification: Retired
Component: sh-utils (Show other bugs)
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
: 34768 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2000-04-25 09:03 EDT by carlosqg
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-06-21 11:10:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Here's the fix (281 bytes, patch)
2001-06-21 11:06 EDT, Tim Waugh
no flags Details | Diff
Actually, this one is better. (523 bytes, patch)
2001-06-21 11:10 EDT, Tim Waugh
no flags Details | Diff

  None (edit)
Description carlosqg 2000-04-25 09:03:08 EDT
When logged in as root and execute:

su - username -c "exit 2"; echo $?

The result is 0 not 2. It seems su does not return the error code from
executing the command to the invoking shell. Please fix it since the
application I try to port from (HP-UX) relies on this functionality of su.

I'm using sh-utils.2.0-1 package.
Comment 1 Bernhard Rosenkraenzer 2001-05-20 06:14:57 EDT
*** Bug 34768 has been marked as a duplicate of this bug. ***
Comment 2 Bernhard Rosenkraenzer 2001-05-20 06:16:41 EDT
This is fixed in sh-utils-2.0.11-1 (rawhide)
Comment 3 Patrick C. F. Ernzer 2001-06-21 10:28:13 EDT
The problem exists with sh-utils-2.0.11-2

Was the fix dropped between 2.0.11-1 and 2.0.11-2?
Comment 4 Tim Waugh 2001-06-21 11:06:01 EDT
Created attachment 21465 [details]
Here's the fix
Comment 5 Tim Waugh 2001-06-21 11:10:49 EDT
Created attachment 21466 [details]
Actually, this one is better.
Comment 6 Bernhard Rosenkraenzer 2001-07-18 07:04:38 EDT
The problem with 2.0.11-1 -> 2.0.11-2 was that 2.0.11-1 accidentally nuked PAM 
support (bad configure check), and the problem exists only if PAM support is 
being used. PAM was fixed in 2.0.11-2 -> the bug re-appeared.

I've added the fix in 2.0.11-3.

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