Bug 157204 - shell_cmd should use waitpid instead of wait
shell_cmd should use waitpid instead of wait
Status: CLOSED DUPLICATE of bug 156373
Product: Fedora
Classification: Fedora
Component: tcp_wrappers (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-09 08:31 EDT by Francis Montagnac
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-05-11 11:08:16 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)

  None (edit)
Description Francis Montagnac 2005-05-09 08:31:30 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041220

Description of problem:

The shell_cmd function in shell_cmd.c does the following loop to
wait for its command to terminate:

  while ((wait_pid = wait((int *) 0)) != -1 && wait_pid != child_pid)

Having now the waitpid primitive, it would be safer to use it instead:

  waitpid(child_pid, (int *) 0, 0)

otherwise an application linked with tcp_wrappers and needing to get
the exit status of its children may fail because of that loop in
shell_cmd, if /etc/hosts.allow is setup to fork a command for this
application.

That happened on our site with am-utils (amd and amq).

Version-Release number of selected component (if applicable):
tcp_wrappers-7.6-37.2.rpm

How reproducible:
Sometimes

Steps to Reproduce:
1. acces to many automount points
2. tell amd to unmount them with "amq -u"
3. repeat 1. end 2.
  

Additional info:
Comment 1 Thomas Woerner 2005-05-11 11:08:16 EDT

*** This bug has been marked as a duplicate of 156373 ***

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