Bug 2308

Summary: su doesn't print error message when fork () fails
Product: [Retired] Red Hat Linux Reporter: martin
Component: sh-utilsAssignee: Cristian Gafton <gafton>
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: martin
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-07-29 01:13:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description martin 1999-04-21 10:28:54 UTC
There's a small problem in su (sh-utils 1.16):

run_shell () is already run with the target user's identity;
when USE_PAM you'll find this code around line 519:

  child = fork();
  if (child == 0) {  /* child shell */

This uses a fork () when we already have the identity of
the target user and does not catch any errors when this
fork fails.

The problem occured when trying to su from root to a
non-root user which already had the maximum number of
possible processes running. Su simply died without doing
anything and there was no error message at all.

One should change this code to make it at least write an
error message to syslog - it is very confusing for root
if the su simply fails without printing an error message.


Comment 1 Jay Turner 1999-06-30 16:46:59 UTC
This issue has been forwarded to a developer for further action.

Comment 2 Cristian Gafton 1999-07-29 01:13:59 UTC
fixed in sh-utils-1.16-24 and later