Bug 302401 - Several misbehaviors in pm-utils scripts
Several misbehaviors in pm-utils scripts
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: pm-utils (Show other bugs)
7
All Linux
low Severity high
: ---
: ---
Assigned To: Till Maas
Fedora Extras Quality Assurance
:
: 235930 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-23 18:45 EDT by Ben Slusky
Modified: 2008-06-12 22:20 EDT (History)
3 users (show)

See Also:
Fixed In Version: 0.99.4-19.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-12 22:20:18 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 Ben Slusky 2007-09-23 18:45:29 EDT
Description of problem:

 1. In /usr/lib/pm-utils/functions, lines 26 and 62;
       /usr/sbin/pm-powersave, line 29:
    These functions use globs to build up a list of files, which are
    subsequently processed by basename. If the directory (i.e. one of
    /etc/pm/{config,power,sleep}.d) is empty, then the glob will remain
    unchanged, basename will turn it into "*", and in each case the
    subsequent for-loop will run over all files in the current directory
    (which I guess is probably /).

    Use "shopt -s nullglob" to prevent this.

 2. In /usr/lib/pm-utils/functions, line 63;
       /usr/sbin/pm-powersave, line 30:
    These functions seem to return a list of files in /etc/pm/$FOO.d
    and /usr/lib/pm-utils/$FOO.d, with files in the former directory
    masking files in the latter directory. However, this is not what
    actually happens.  If a file called $BAR exists in both of those
    directories, then the functions will list /etc/pm/$FOO.d/$BAR twice.
    In each case this means that /etc/pm/$FOO.d/$BAR will be run twice,
    which is probably not the desired behavior.

    Change "| sort -n" to "| sort -un" to fix this.

 3. In /usr/lib/pm-utils/functions, lines 26-27:
	...
	for cfg in $cfgs ; do
		[ -f $cfgs ] || continue
		...
    Clearly line 27 should read "[ -f $cfg ] || continue".

Version-Release number of selected component (if applicable):
pm-utils-0.99.3-6.fc7

How reproducible:

 Trivially.
Comment 1 Till Maas 2007-09-24 15:15:21 EDT
Nr. 3 will be fixed with the next push to stable, I will look into the other
issues later this week.
Comment 2 Ben Slusky 2007-09-25 09:47:10 EDT
Re: #2 -- Oops, "sort -un" is not right either. I think "sort -n | uniq" is needed.
Comment 3 Till Maas 2007-09-25 15:13:44 EDT
(In reply to comment #2)
> Re: #2 -- Oops, "sort -un" is not right either. I think "sort -n | uniq" is
needed.

What is the difference?
Comment 4 Ben Slusky 2007-09-25 18:18:19 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Re: #2 -- Oops, "sort -un" is not right either. I think "sort -n | uniq" is
> needed.
> 
> What is the difference?

"sort -un" only counts the numeric part when determining uniqueness.

    $ { echo 1foo; echo 1bar; echo 2baz; } |sort -un
    1foo
    2baz
Comment 5 Till Maas 2007-12-24 07:41:11 EST
*** Bug 235930 has been marked as a duplicate of this bug. ***
Comment 6 Till Maas 2007-12-30 19:43:09 EST
Fixed in Rawhide and Upstream, it will go in updates-testing, when there is no
negative feedback.
Comment 7 Richard Hughes 2008-04-08 03:56:31 EDT
Is this now fixed upstream (we did a rewrite..)?
http://pm-utils.freedesktop.org/wiki/
Comment 8 Till Maas 2008-04-08 04:10:10 EDT
(In reply to comment #7)
> Is this now fixed upstream (we did a rewrite..)?

Yes, it is (see comment:7) ;-)

Comment 9 Fedora Update System 2008-04-19 09:46:06 EDT
pm-utils-0.99.4-17.fc7 has been submitted as an update for Fedora 7
Comment 10 Fedora Update System 2008-04-19 09:46:34 EDT
pm-utils-0.99.4-17.fc8 has been submitted as an update for Fedora 8
Comment 11 Fedora Update System 2008-04-22 18:38:06 EDT
pm-utils-0.99.4-17.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update pm-utils'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F7/FEDORA-2008-3246
Comment 12 Bug Zapper 2008-05-14 10:27:48 EDT
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 13 Fedora Update System 2008-05-18 13:24:08 EDT
pm-utils-0.99.4-18.fc8 has been submitted as an update for Fedora 8
Comment 14 Ben Slusky 2008-06-08 20:23:02 EDT
Unfortunately I can't test pm-utils-0.99.4-17.fc7 because I've upgraded, but it
looks fixed to me. I also can't test pm-utils-0.99.4-18.fc8 because it isn't in
the testing repo. :-/
Comment 15 Fedora Update System 2008-06-09 18:28:13 EDT
pm-utils-0.99.4-19.fc8 has been submitted as an update for Fedora 8
Comment 16 Till Maas 2008-06-09 19:12:50 EDT
(In reply to comment #14)
> Unfortunately I can't test pm-utils-0.99.4-17.fc7 because I've upgraded, but it
> looks fixed to me. I also can't test pm-utils-0.99.4-18.fc8 because it isn't in
> the testing repo. :-/

There was another bug I wanted to fix before the package goes to stable, the -19
build should soon be in the testing repo.
Comment 17 Fedora Update System 2008-06-12 22:20:06 EDT
pm-utils-0.99.4-19.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

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