From 4fe96950186e616db17767ce78690f7b82231a51 Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Sun, 16 Mar 2008 11:24:55 -0500 Subject: Fix bug where pm-is-supported could only be run as root. Now we only parse the blacklist and the default parameters when we are taking the suspend lock. --- pm/pm-functions.in | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pm') diff --git a/pm/pm-functions.in b/pm/pm-functions.in index 1e86739..c14e534 100644 --- a/pm/pm-functions.in +++ b/pm/pm-functions.in @@ -48,9 +48,10 @@ for cfg in "${PM_UTILS_ETCDIR}"/config.d/*[!~] ; do done . "${PM_FUNCTIONS}" -mkdir -p "$STORAGEDIR" -[ -f "$PM_UTILS_ETCDIR/blacklist" ] && { +load_hook_blacklist() +{ + [ -f "$PM_UTILS_ETCDIR/blacklist" ] || return # loop through the blacklist file, adding entries to our hook blacklist. # Blacklist file format: # name debugging text @@ -63,7 +64,9 @@ mkdir -p "$STORAGEDIR" done } -[ -f "$PM_UTILS_ETCDIR/parameters" ] && { +load_hook_parameters() +{ + [ -f "$PM_UTILS_ETCDIR/parameters" ] || return # loop through the parameters file, and add each line in it to the # end of PM_CMDLINE. # Comments begin with hashmarks and run to the end of the line. @@ -82,6 +85,8 @@ take_suspend_lock() { try_lock "pm-utils.lock" || return 1 mkdir -p "${STORAGEDIR}" + load_hook_blacklist + load_hook_parameters return 0 } -- cgit v1.2.3