Bug 16275 - Infinite recursion in "apmd status" script
Infinite recursion in "apmd status" script
Product: Red Hat Linux
Classification: Retired
Component: apmd (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Depends On:
  Show dependency treegraph
Reported: 2000-08-15 14:17 EDT by andrzej
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-08-16 18:05:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description andrzej 2000-08-15 14:17:09 EDT
The script in /etc/rc.d/init.d/apmd defines a shell function status(),
which includes the line "status apmd". This was presumably intended to
invoke the status() of /etc/init.d/functions, but instead ends up calling
itself recursively, ultimately leading to the shell running out of memory
and crashing.

A natural fix would be to rename the status() of apmd, or to simply inline
its body in the case-statement below.
Comment 1 Alan Cox 2000-08-16 06:43:58 EDT

Replacing status with dostatus() for the internal function makes everything
happy again
Comment 2 Glen Foster 2000-08-16 18:05:04 EDT
Bero, please fix this ASAP.
Comment 3 Phil Knirsch 2000-08-17 12:17:01 EDT
Has been fixed (probably by Bero).
Comment 4 Gregory Leblanc 2000-09-18 18:51:52 EDT
Would this be liable to cause '/etc/rc.d/init.d/apmd status' to seg fault and
dump core?  gdb -c core followed by bt gives me a very very very long list of
calls.  Thanks,

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