Bug 215121 - Machine dies when running /etc/cron.daily/rpm under certain unusual circumstances
Summary: Machine dies when running /etc/cron.daily/rpm under certain unusual circumsta...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: rpm
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Panu Matilainen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-11 05:29 UTC by Martin Sheppard
Modified: 2012-06-20 16:57 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 16:57:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Sheppard 2006-11-11 05:29:06 UTC
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 13:27:26 UTC
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 22:38:27 UTC
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 16:57:00 UTC
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.