Bug 185979 - pm-utils should not run hooks with filenames ending in tilde
pm-utils should not run hooks with filenames ending in tilde
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: pm-utils (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-20 12:22 EST by Luke Hutchison
Modified: 2015-03-04 20:16 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-28 17:26:13 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 Luke Hutchison 2006-03-20 12:22:54 EST
In /etc/pm/functions, there is the following function:

run_hooks()
{
        [ -z "$1" ] && return 0
        files="/etc/pm/hooks/*"
        if [ "$2" = "reverse" ]; then
                files=$(echo $files | awk '{ for (i=NF; i>=1; i--) print $i }')
        fi
        for file in $files ; do
                [ -x $file ] && $file $1
        done
}

Rather than looking for /etc/pm/hooks/*, It should really look for all files
_but_ those ending in a tilde (~).  This stops backup files (written by emacs
etc.) being run.
Comment 1 Peter Jones 2006-09-28 17:26:13 EDT
Should be fixed in 0.19.1-2

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