Hello community, here is the log from the commit of package upower for openSUSE:Factory checked in at 2018-03-30 11:55:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/upower (Old) and /work/SRC/openSUSE:Factory/.upower.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "upower" Fri Mar 30 11:55:23 2018 rev:59 rq:590598 version:0.99.7 Changes: -------- --- /work/SRC/openSUSE:Factory/upower/upower.changes 2018-03-09 10:47:28.572775806 +0100 +++ /work/SRC/openSUSE:Factory/.upower.new/upower.changes 2018-03-30 11:55:28.735648151 +0200 @@ -1,0 +2,6 @@ +Tue Mar 20 14:15:49 UTC 2018 - novell@mirell.de + +- Add upower-fix-ios-crash.patch to fix repeating crashes on some + iOS devices like the Apple TV (fdo#105625). + +------------------------------------------------------------------- New: ---- upower-fix-ios-crash.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ upower.spec ++++++ --- /var/tmp/diff_new_pack.FpdCHI/_old 2018-03-30 11:55:29.823608803 +0200 +++ /var/tmp/diff_new_pack.FpdCHI/_new 2018-03-30 11:55:29.831608514 +0200 @@ -28,10 +28,12 @@ Summary: Power Device Enumeration Framework License: GPL-2.0-or-later Group: System/Daemons -URL: http://upower.freedesktop.org/ +Url: http://upower.freedesktop.org/ Source: http://upower.freedesktop.org/releases/%{name}-%{version}.tar.xz # PATCH-FEATURE-OPENSUSE upower-hibernate-insteadof-hybridsleep.patch boo#985741 dimstar@opensuse.org -- Set the system per default to hibernate, not hybridsleep Patch0: upower-hibernate-insteadof-hybridsleep.patch +# PATCH-FIX-UPSTREAM upower-fix-ios-crash.patch fdo#105625 novell@mirell.de -- Fix endless crash loop freezing the system with AppleTV attached +Patch1: upower-fix-ios-crash.patch BuildRequires: gobject-introspection-devel >= 0.9.9 BuildRequires: gtk-doc >= 1.11 BuildRequires: intltool @@ -102,6 +104,7 @@ %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %configure\ ++++++ upower-fix-ios-crash.patch ++++++
From 9357aa60e7773d997e6208c9b3cab09adc166e38 Mon Sep 17 00:00:00 2001 From: Martin Szulecki <martin.szulecki@libimobiledevice.org> Date: Tue, 20 Mar 2018 15:00:21 +0100 Subject: [PATCH 1/2] linux: Prevent crash after attaching an Apple TV
As Apple TVs do not have a battery and do not provide the "BatteryIsCharging" lockdown key, upower would crash due to a missing check whether the retrieved node is actually valid. https://bugzilla.freedesktop.org/show_bug.cgi?id=105625 --- src/linux/up-device-idevice.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c index 97d230c..a583881 100644 --- a/src/linux/up-device-idevice.c +++ b/src/linux/up-device-idevice.c @@ -297,6 +297,10 @@ up_device_idevice_refresh (UpDevice *device) /* get charging status */ node = plist_dict_get_item (dict, "BatteryIsCharging"); + if (!node) { + plist_free(dict); + goto out; + } plist_get_bool_val (node, &charging); if (percentage == 100) -- 2.16.2
From 598fdbc5e00573d1b56d4107798f82bd615842b3 Mon Sep 17 00:00:00 2001 From: Martin Szulecki <martin.szulecki@libimobiledevice.org> Date: Tue, 20 Mar 2018 15:04:26 +0100 Subject: [PATCH 2/2] linux: Check "HasBattery" key for newer iOS versions
This adds an extra check to query if the iOS device has a battery at all before actually trying to retrieve the battery status. Should still work for older iOS versions which do not provide this key. https://bugzilla.freedesktop.org/show_bug.cgi?id=105625 --- src/linux/up-device-idevice.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c index a583881..0c404cc 100644 --- a/src/linux/up-device-idevice.c +++ b/src/linux/up-device-idevice.c @@ -269,7 +269,7 @@ up_device_idevice_refresh (UpDevice *device) lockdownd_client_t client = NULL; plist_t dict, node; guint64 percentage; - guint8 charging; + guint8 charging, has_battery; UpDeviceState state; gboolean retval = FALSE; @@ -284,6 +284,15 @@ up_device_idevice_refresh (UpDevice *device) if (lockdownd_get_value (client, "com.apple.mobile.battery", NULL, &dict) != LOCKDOWN_E_SUCCESS) goto out; + node = plist_dict_get_item (dict, "HasBattery"); + if (node) { + plist_get_bool_val (node, &has_battery); + if (!has_battery) { + plist_free(dict); + goto out; + } + } + /* get battery status */ node = plist_dict_get_item (dict, "BatteryCurrentCapacity"); if (!node) { -- 2.16.2
participants (1)
-
root@hilbert.suse.de