ethernet module has a control flow bug

Bug #662924 reported by Faustus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
laptop-mode-tools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: laptop-mode-tools

First,

/usr/share/laptop-mode-tools/modules/ethernet: if ! [ -z $path ]; then
/usr/share/laptop-mode-tools/modules/ethernet: if ! [ -z $dev_path ] && [ -f $dev_path/enable ]; then

are confusing without the quotes around the variable given to -z (but it still works in Bash).

Second, in the ETHERNET devices loop, if $path is empty, previous value for $dev_path will be used (redundantly operating on the device).

Revision history for this message
Ritesh Raj Sarraf (rrs) wrote : Re: [Bug 662924] [NEW] ethernet module has a control flow bug

On Tuesday 19 Oct 2010 01:56:38 Faustus wrote:
> First,
>
> /usr/share/laptop-mode-tools/modules/ethernet: if ! [ -z
> $path ]; then
> /usr/share/laptop-mode-tools/modules/ethernet: if ! [ -z
> $dev_path ] && [ -f $dev_path/enable ]; then
>
> are confusing without the quotes around the variable given to -z (but it
> still works in Bash).
>

So does it not work with dash ?
laptop-mode-tools uses dash and I haven't seen this bug report. In case you
see problems when run with dash, please report.

> Second, in the ETHERNET devices loop, if $path is empty, previous value
> for $dev_path will be used (redundantly operating on the device).

Thank you. I have fixed this in the upstream branch. Will be part of the next
(1.56) release.

Ritesh

--
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."

Revision history for this message
Faustus (orlovm) wrote :

> So does it not work with dash? laptop-mode-tools uses dash and I haven't seen this bug report. In case you
see problems when run with dash, please report.

What is dash? On Gentoo, /usr/sbin/laptop_mode uses /bin/sh, which is a link to /bin/bash. It works, and I don't see a reason to use what looks like an obscure bug/feature for no reason.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.3 KiB)

This bug was fixed in the package laptop-mode-tools - 1.57-1ubuntu1

---------------
laptop-mode-tools (1.57-1ubuntu1) natty; urgency=low

  * Merge with Debian unstable. Remaining Ubuntu changes:
    - debian/rules: Do not ship acpi/apm scripts (we handle that ourselves)
  * Drop previous Ubuntu changes for /etc/default/laptop-mode. We don't
    install this package by default any more for a long time, so if people
    install it manually they presumably want to install it. 1.53 added its own
    global enable/disable switch, so this is obsolete, too.
  * This version removes the file conflict with pm-utils. (LP: #638307)

laptop-mode-tools (1.57-1) unstable; urgency=low

  * New Upstream Release
    + Pass calling application's arguments to the main function. Thanks to
      Radek for the report and the patch
    + Use governor policy from the config file. Thanks to Michael Orlov for
      the report.
    + Enable ENABLE_AUTO_MODULES by default. When a user installs the package,
      the first immediate expectation is to see some changes
    + USB suspend interface has changed with kernels 2.6.35 and above.
      (Closes: #589000)
    + Add support for Linux Runtime Power Management (Closes: #592661)
    + On many other distributions, wireless-tools packages is still old and
      does not return proper exit status on failures. Thanks to Luca Landolfi
      for the patch.
    + Add support to blacklist USB Devices by types. Thanks to Simon Que for
      the patch
    + Re-initialize dev_path before the next iteration. Thanks to Faustus for
      the bug report and the patch (LP: #662924)
    + ENABLE_LAPTOP_MODE_TOOLS was ignore because of wrong check. Thanks to
      Matus Harvan for reporting this. (Closes: #602278)
    + Add support to invoke laptop-mode-tools with hotplug events. This
      currently only has support for the usb-autosuspend module.
      Thanks to Simon Que for the patch
    + Add locking support using flock. (Closes: #566613)
    + Add 99-laptop-mode.rules to trap multiple kernel events
  * Drop pm-utils from recommends since it conflicts with us (Closes: #614024)
  * Bump Standards Version to 3.9.1 (No changes required)

laptop-mode-tools (1.55-1) unstable; urgency=low

  * Change address to my official Debian address
  * New Upstream Release
    + On Intel HD Audio, revert power saving changes when switching back to AC.
      Thanks to Christoph Langguth for the report and the patch
    + Install the pm-utils hook as 01laptop-mode to ensure proper execution in
      reverse ordering
    + Add wireless-power module, for generic non-Intel wireless interfaces that
      support the iwconfig "power" option.
    + Fixed upgrade path for configurations which didn't have the LM/NOLM
      options in the Intel SATA Power Management module config.
    + Add flush-* to ignored programs for lm-profiler, because it is the
      successor to pdflush.
    + Fix WoL regression introduced by DISABLE_ETHERNET_ON_BATTERY. Thanks
      to Matthias Dienstbier for the report and the patch
    + Update comments in wireless-iwl-power.conf. (Debian BTS: #580730)
    + Check for old hook in pm-utils and remove it
    + Update manpage for al...

Read more...

Changed in laptop-mode-tools (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.