[upower/f14/master] Prevent a crash

Matthias Clasen mclasen at fedoraproject.org
Fri Aug 13 01:49:47 UTC 2010


commit d4b19fa825f4acf63dff77ab96b64eafe1a4189a
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Thu Aug 12 21:48:40 2010 -0400

    Prevent a crash

 upower-clear-error.patch |   19 +++++++++++++++++++
 upower.spec              |    9 ++++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/upower-clear-error.patch b/upower-clear-error.patch
new file mode 100644
index 0000000..8f97089
--- /dev/null
+++ b/upower-clear-error.patch
@@ -0,0 +1,19 @@
+diff -up upower-0.9.5/src/up-polkit.c.clear-error upower-0.9.5/src/up-polkit.c
+--- upower-0.9.5/src/up-polkit.c.clear-error	2010-08-12 21:43:03.739052001 -0400
++++ upower-0.9.5/src/up-polkit.c	2010-08-12 21:44:00.787052001 -0400
+@@ -73,6 +73,7 @@ up_polkit_check_auth (UpPolkit *polkit, 
+ 	PolkitAuthorizationResult *result;
+ 
+ 	/* check auth */
++        error_local = NULL;
+ 	result = polkit_authority_check_authorization_sync (polkit->priv->authority, subject, action_id, NULL, POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION, NULL, &error_local);
+ 	if (result == NULL) {
+ 		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "failed to check authorisation: %s", error_local->message);
+@@ -108,6 +109,7 @@ up_polkit_is_allowed (UpPolkit *polkit, 
+ 	PolkitAuthorizationResult *result;
+ 
+ 	/* check auth */
++        error_local = NULL;
+ 	result = polkit_authority_check_authorization_sync (polkit->priv->authority, subject, action_id, NULL, POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE, NULL, &error_local);
+ 	if (result == NULL) {
+ 		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "failed to check authorisation: %s", error_local->message);
diff --git a/upower.spec b/upower.spec
index cec8b8f..fdb04da 100644
--- a/upower.spec
+++ b/upower.spec
@@ -1,7 +1,7 @@
 Summary:        Power Management Service
 Name:           upower
 Version:        0.9.5
-Release:        4%{?dist}
+Release:        5%{?dist}
 License:        GPLv2+
 Group:          System Environment/Libraries
 URL:            http://hal.freedesktop.org/releases/
@@ -31,6 +31,9 @@ Obsoletes: DeviceKit-power < 1:0.9.0-2
 # We will drop this in F15
 Provides: DeviceKit-power
 
+# Prevent a crash when gnome-power-manager starts up
+Patch0: upower-clear-error.patch
+
 %description
 UPower (formerly DeviceKit-power) provides a daemon, API and command
 line tools for managing power devices attached to the system.
@@ -49,6 +52,7 @@ Headers and libraries for UPower.
 
 %prep
 %setup -q
+%patch0 -p1 -b .clear-error
 
 %build
 %configure \
@@ -108,6 +112,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 %{_includedir}/libupower-glib/upower.h
 
 %changelog
+* Thu Aug 12 2010 Matthias Clasen <mclasen at redhat.com> 0.9.5-5
+- Prevent crash due to uninitialized GError
+
 * Mon Jul 26 2010 Bastien Nocera <bnocera at redhat.com> 0.9.5-4
 - Add support for iDevice battery checking
 


More information about the scm-commits mailing list