aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-07-23 06:43:32 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-07-23 06:43:32 +0000
commitd3062118c9db1d5cdddf1a62a1edae8ee7732cd1 (patch)
treefd40fd382053074375c45911debd77f5e670b9c9
parent6986909c30859510ac7e183ee952b4b017f2115a (diff)
downloadaports-d3062118c9db1d5cdddf1a62a1edae8ee7732cd1.tar.bz2
aports-d3062118c9db1d5cdddf1a62a1edae8ee7732cd1.tar.xz
main/upower: add fixes from upstream
-rw-r--r--main/upower/APKBUILD19
-rw-r--r--main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch33
-rw-r--r--main/upower/linux-Fix-possible-double-free.patch44
3 files changed, 91 insertions, 5 deletions
diff --git a/main/upower/APKBUILD b/main/upower/APKBUILD
index f5c6cac96c..cf0f3acecc 100644
--- a/main/upower/APKBUILD
+++ b/main/upower/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=upower
pkgver=0.99.3
-pkgrel=0
+pkgrel=1
pkgdesc="Power Management Services"
url="http://upower.freedesktop.org"
arch="all"
@@ -10,7 +10,10 @@ depends=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
makedepends="linux-headers gtk+-dev eudev-dev libusb-dev polkit-dev dbus-glib-dev libxslt
docbook-xsl"
-source="http://upower.freedesktop.org/releases/upower-$pkgver.tar.xz"
+source="http://upower.freedesktop.org/releases/upower-$pkgver.tar.xz
+ lib-Fix-memory-leak-in-up_client_get_devices.patch
+ linux-Fix-possible-double-free.patch
+ "
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
@@ -37,6 +40,12 @@ package() {
rm -f "$pkgdir"/usr/lib/*.la
}
-md5sums="a9c95d0545bc23d784642c11e157cfbf upower-0.99.3.tar.xz"
-sha256sums="697199bcc113bb069e6fb6bf4135536a702ba9847e46c5fc6df87d19624ddd38 upower-0.99.3.tar.xz"
-sha512sums="665b5b03605910b3a2d3f32e4846c2b2ab4c91ba91c55dde8c5b8ab3856f3d6fea5efac20fdb608050b57979ed344ef630c76acc0b3f858e8c5168f6adeb2d64 upower-0.99.3.tar.xz"
+md5sums="a9c95d0545bc23d784642c11e157cfbf upower-0.99.3.tar.xz
+e2f1d7810337b9c7dd559bda4b88cfea lib-Fix-memory-leak-in-up_client_get_devices.patch
+48ab7a1f497b8628f0a836aa4e3bd1f1 linux-Fix-possible-double-free.patch"
+sha256sums="697199bcc113bb069e6fb6bf4135536a702ba9847e46c5fc6df87d19624ddd38 upower-0.99.3.tar.xz
+8c62939c1850f4c3b7ee32b5b79496155c03cd1371e7cad26ecfc1e0643f9851 lib-Fix-memory-leak-in-up_client_get_devices.patch
+069e4407b775a28bbf987d145e0d0659dcae4b85e3b9a45a0a3aef0cee23f426 linux-Fix-possible-double-free.patch"
+sha512sums="665b5b03605910b3a2d3f32e4846c2b2ab4c91ba91c55dde8c5b8ab3856f3d6fea5efac20fdb608050b57979ed344ef630c76acc0b3f858e8c5168f6adeb2d64 upower-0.99.3.tar.xz
+d18e4c6119e32297f612fa110e01de342381f38c8be42d4fd5322eb17a2cb172c1cb8bf09e0a25e0ef6b76edb82b6748c9c8fd02f44341f51ecd09141ea432fd lib-Fix-memory-leak-in-up_client_get_devices.patch
+13656064551a9b9e40fe3560098319182e980d2ab48134959f9f642a6c42cb0283b3bd00052ef26834ffea5c3a2108b66fd127e165b2167a43064ccd4ba526b0 linux-Fix-possible-double-free.patch"
diff --git a/main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch b/main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch
new file mode 100644
index 0000000000..3418b04168
--- /dev/null
+++ b/main/upower/lib-Fix-memory-leak-in-up_client_get_devices.patch
@@ -0,0 +1,33 @@
+From fe37183fba649b999af3f66b9e0b0d70a054426c Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 17 Jun 2015 10:52:12 +0200
+Subject: lib: Fix memory leak in up_client_get_devices()
+
+When up_client_get_devices() fails to contact the D-Bus daemon, don't
+leak the newly created array.
+
+diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
+index 48d99a0..4780aa5 100644
+--- a/libupower-glib/up-client.c
++++ b/libupower-glib/up-client.c
+@@ -95,8 +95,6 @@ up_client_get_devices (UpClient *client)
+
+ g_return_val_if_fail (UP_IS_CLIENT (client), NULL);
+
+- array = g_ptr_array_new ();
+-
+ if (up_client_glue_call_enumerate_devices_sync (client->priv->proxy,
+ &devices,
+ NULL,
+@@ -106,6 +104,8 @@ up_client_get_devices (UpClient *client)
+ return NULL;
+ }
+
++ array = g_ptr_array_new ();
++
+ for (i = 0; devices[i] != NULL; i++) {
+ UpDevice *device;
+ const char *object_path = devices[i];
+--
+cgit v0.10.2
+
diff --git a/main/upower/linux-Fix-possible-double-free.patch b/main/upower/linux-Fix-possible-double-free.patch
new file mode 100644
index 0000000000..d63cf4d11d
--- /dev/null
+++ b/main/upower/linux-Fix-possible-double-free.patch
@@ -0,0 +1,44 @@
+From c9b2e177267b623850b3deedb1242de7d2e413ee Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Fri, 26 Jun 2015 14:07:13 +0200
+Subject: linux: Fix possible double-free
+
+When reopening the lockdown daemon with upower as the client, don't
+double-free if the user says "No" to trusting the laptop.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1231763
+
+diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c
+index 9722774..6ab1bf8 100644
+--- a/src/linux/up-device-idevice.c
++++ b/src/linux/up-device-idevice.c
+@@ -74,7 +74,7 @@ start_poll_cb (UpDeviceIdevice *idevice)
+ UpDevice *device = UP_DEVICE (idevice);
+ idevice_t dev = NULL;
+ lockdownd_client_t client = NULL;
+- char *uuid;
++ char *uuid = NULL;
+
+ g_object_get (G_OBJECT (idevice), "serial", &uuid, NULL);
+ g_assert (uuid);
+@@ -83,7 +83,7 @@ start_poll_cb (UpDeviceIdevice *idevice)
+ if (idevice_new (&dev, uuid) != IDEVICE_E_SUCCESS)
+ goto out;
+
+- g_free (uuid);
++ g_clear_pointer (&uuid, g_free);
+
+ if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake (dev, &client, "upower"))
+ goto out;
+@@ -111,7 +111,7 @@ start_poll_cb (UpDeviceIdevice *idevice)
+ out:
+ g_clear_pointer (&client, lockdownd_client_free);
+ g_clear_pointer (&dev, idevice_free);
+- g_free (uuid);
++ g_clear_pointer (&uuid, g_free);
+ return G_SOURCE_CONTINUE;
+ }
+
+--
+cgit v0.10.2
+