Bug 185979

Summary: pm-utils should not run hooks with filenames ending in tilde
Product: [Fedora] Fedora Reporter: Luke Hutchison <luke.hutch>
Component: pm-utilsAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-09-28 21:26:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Luke Hutchison 2006-03-20 17:22:54 UTC
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 21:26:13 UTC
Should be fixed in 0.19.1-2