Bug 215121 - Machine dies when running /etc/cron.daily/rpm under certain unusual circumstances
Machine dies when running /etc/cron.daily/rpm under certain unusual circumsta...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: rpm (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Panu Matilainen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-11 00:29 EST by Martin Sheppard
Modified: 2012-06-20 12:57 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 12:57:00 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 Martin Sheppard 2006-11-11 00:29:06 EST
Description of problem:

If the path is set to include /etc/cron.daily before /bin (either directly or
using '.') then executing /etc/cron.daily/rpm causes the machine to go into an
infinite loop and probably die because the script /etc/cron.daily/rpm tries to
run the rpm command, but instead of finding /bin/rpm it finds
/etc/cron.daily/rpm instead which re-executes the script which continues over
and over again. 

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

Steps to Reproduce:
1. Run: export PATH=/etc/cron.daily:$PATH    (alternatively export PATH=.:$PATH
2. Run: rpm

Actual results:
Machine dies
 
Expected results:
Machine doesn't die

Additional info:
It is an unusual situation, but given the drastic consequences if the bug is
triggered it may be worth fixing. It could be fixed in a number of ways:

1. Explicitly setting the path from within the /etc/cron.daily/rpm script

2. Renaming the script from /etc/cron.daily/rpm to something else, e.g.
/etc/cron.daily/rpmpkgs

3. Calling "/bin/rpm" from within /etc/cron.daily/rpm rather than just "rpm"
Comment 1 Jeff Johnson 2006-11-11 08:27:26 EST
Here's the daily script from rpm-4.4.8:

#!/bin/sh

/usr/bin/rpmquery -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \
        | sort > /var/log/rpmpkgs
Comment 2 Burt Holzman 2008-01-02 17:38:27 EST
We got bit by this here recently -- an overzealous admin moved the
/etc/cron.daily script out to somewhere in root's path, and subsequent rpm
commands triggered recursive execution as well.  Backporting the daily script
from rpm-4.4.8 seems like an easy fix.
Comment 3 Jiri Pallich 2012-06-20 12:57:00 EDT
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

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