on_ac_power fails if the path contains a whitespace

Bug #1816404 reported by Roman Shipovskij
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
powermgmt-base (Debian)
Fix Released
Unknown
powermgmt-base (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
powermgmt-base: 1.33

on_ac_power fails if the path contains a whitespace, solution is attached as patch.

before patch:
~# sh -x /usr/bin/on_ac_power; echo $?
+ set -e
+ OFF_LINE_P=no
+ [ -d /sys/class/power_supply/ ]
+ test -d /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA Rev:PAACFS00-002-R003-battery
+ test -r /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA Rev:PAACFS00-002-R003-battery/type
+ cat /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA Rev:PAACFS00-002-R003-battery/type
cat: '/sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA': No such file or directory
cat: 'Rev:PAACFS00-002-R003-battery/type': No such file or directory
+ type=
1

after patch:
~# sh -x /usr/bin/on_ac_power; echo $?
+ set -e
+ OFF_LINE_P=no
+ [ -d /sys/class/power_supply/ ]
+ test -d /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA Rev:PAACFS00-002-R003-battery
+ test -r /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA Rev:PAACFS00-002-R003-battery/type
+ cat /sys/class/power_supply/hid-S!N:A7E462F2A0494518B37F374DE00488AA Rev:PAACFS00-002-R003-battery/type
+ type=Battery
+ [ no = yes ]
+ [ -d /proc/acpi/ac_adapter ]
+ [ -r /proc/pmu/info ]
+ [ -r /proc/apm ]
+ exit 255
255

Tags: patch
Revision history for this message
Roman Shipovskij (roman-shipovskij) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in powermgmt-base (Ubuntu):
status: New → Confirmed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "whitespace.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Mathew Hodson (mhodson)
Changed in powermgmt-base (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Simon Quigley (tsimonq2) wrote :

Forwarded to Debian, to get their opinion on this.

Unsubscribing the Ubuntu Sponsors Team.

Changed in powermgmt-base (Debian):
status: Unknown → New
Simon Quigley (tsimonq2)
Changed in powermgmt-base (Ubuntu):
status: Confirmed → Fix Released
Changed in powermgmt-base (Debian):
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.