Launchpad has imported 3 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=94323.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2016-02-28T01:54:18+00:00 Dirk F wrote:

Created attachment 122012
patch taken from running pm-functions; also fixes comment typo

The function run_hooks() in pm-functions proposes to-be-executed hooks
that includes subdirectories in the hook directories but neither fully
validates each such hook as a regular file nor handles a set of to-be-
executed hooks in a subdirectory. This can cause a hook to be executed
more than once.

At lines 241 on, there is a code path with no else clause:

  if [ -f "$syshooks/$base" ]; then
   hook="$syshooks/$base"
  elif [ -f "$phooks/$base" ]; then
   hook="$phooks/$base"
  fi

If the $base proposed by the for statement at line 229 doesn't match
either of the -f tests (which will happen eg if a hook is configured in
a subdirectory of the hook directory), the $hook from the previous
iteration can be accidentally reused.

An easy fix is to insert the missing else clause before the fi line so
that the script skips the subdirectory or other non-regular file and
carries on with the next correctly specified hook, as in the attached
patch.

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548486/comments/2

------------------------------------------------------------------------
On 2016-02-28T01:59:57+00:00 Dirk F wrote:

Created attachment 122013
patch taken from running pm-functions; also fixes comment typo

(attached wrong file)

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548486/comments/3

------------------------------------------------------------------------
On 2018-06-29T19:57:09+00:00 Ajax-a wrote:

pm-utils hasn't been touched in eight years, none of this is likely to
get addressed. Closing bugs and disabling the bz product.

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548486/comments/14


** Changed in: pm-utils
       Status: Unknown => Won't Fix

** Changed in: pm-utils
   Importance: Unknown => Medium

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548486

Title:
  Sleep hook in a subdirectory ignored but causes double execution of
  previous hook

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548486/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to