[upower/f14/master] fix patch

Matthias Clasen mclasen at fedoraproject.org
Wed Aug 18 02:18:11 UTC 2010


commit 3d491fa7119c1d7ff37e2efc813fb7d1c5e72951
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Tue Aug 17 22:16:59 2010 -0400

    fix patch

 upower-dbus-fixes.patch |  103 ++++++++++++++++++-----------------------------
 1 files changed, 39 insertions(+), 64 deletions(-)
---
diff --git a/upower-dbus-fixes.patch b/upower-dbus-fixes.patch
index 01759a6..f813439 100644
--- a/upower-dbus-fixes.patch
+++ b/upower-dbus-fixes.patch
@@ -1,8 +1,7 @@
-diff --git a/src/up-daemon.c b/src/up-daemon.c
-index 3fb952b..4884b64 100644
---- a/src/up-daemon.c
-+++ b/src/up-daemon.c
-@@ -323,6 +323,7 @@ up_daemon_about_to_sleep (UpDaemon *daemon, DBusGMethodInvocation *context)
+diff -up upower-0.9.5/src/up-daemon.c.dbus-fixes upower-0.9.5/src/up-daemon.c
+--- upower-0.9.5/src/up-daemon.c.dbus-fixes	2010-07-08 03:50:24.000000000 -0400
++++ upower-0.9.5/src/up-daemon.c	2010-08-17 22:14:59.429257004 -0400
+@@ -323,6 +323,7 @@ up_daemon_about_to_sleep (UpDaemon *daem
  				     UP_DAEMON_ERROR_GENERAL,
  				     "Sleep has already been requested and is pending");
  		dbus_g_method_return_error (context, error);
@@ -10,7 +9,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -376,6 +377,7 @@ up_daemon_deferred_sleep_cb (UpDaemonDeferredSleep *sleep)
+@@ -376,6 +377,7 @@ up_daemon_deferred_sleep_cb (UpDaemonDef
  				     "Failed to spawn: %s, stdout:%s, stderr:%s", error_local->message, stdout, stderr);
  		g_error_free (error_local);
  		dbus_g_method_return_error (sleep->context, error);
@@ -18,7 +17,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -470,6 +472,7 @@ up_daemon_suspend (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -470,6 +472,7 @@ up_daemon_suspend (UpDaemon *daemon, DBu
  				     UP_DAEMON_ERROR_GENERAL,
  				     "No kernel support");
  		dbus_g_method_return_error (context, error);
@@ -26,16 +25,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -477,7 +480,7 @@ up_daemon_suspend (UpDaemon *daemon, DBusGMethodInvocation *context)
- 	if (subject == NULL)
- 		goto out;
- 
--	if (!up_polkit_check_auth (priv->polkit, subject, "org.freedesktop.upower.suspend", context))
-+	if (!up_polkit_check_auth (priv->polkit, subject, "org.freedesktop.upower.suspend", context))
- 		goto out;
- 
- 	/* already requested */
-@@ -486,6 +489,7 @@ up_daemon_suspend (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -486,6 +489,7 @@ up_daemon_suspend (UpDaemon *daemon, DBu
  				     UP_DAEMON_ERROR_GENERAL,
  				     "Sleep has already been requested and is pending");
  		dbus_g_method_return_error (context, error);
@@ -43,7 +33,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -507,13 +511,21 @@ up_daemon_suspend_allowed (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -507,13 +511,21 @@ up_daemon_suspend_allowed (UpDaemon *dae
  	gboolean ret;
  	PolkitSubject *subject = NULL;
  	UpDaemonPrivate *priv = daemon->priv;
@@ -67,7 +57,7 @@ index 3fb952b..4884b64 100644
  
  out:
  	if (subject != NULL)
-@@ -563,6 +575,7 @@ up_daemon_hibernate (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -563,6 +575,7 @@ up_daemon_hibernate (UpDaemon *daemon, D
  				     UP_DAEMON_ERROR_GENERAL,
  				     "No kernel support");
  		dbus_g_method_return_error (context, error);
@@ -75,7 +65,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -572,6 +585,7 @@ up_daemon_hibernate (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -572,6 +585,7 @@ up_daemon_hibernate (UpDaemon *daemon, D
  				     UP_DAEMON_ERROR_GENERAL,
  				     "Not enough swap space");
  		dbus_g_method_return_error (context, error);
@@ -83,7 +73,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -582,6 +596,7 @@ up_daemon_hibernate (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -582,6 +596,7 @@ up_daemon_hibernate (UpDaemon *daemon, D
  				     UP_DAEMON_ERROR_GENERAL,
  				     "Swap space is encrypted, use AllowHibernateEncryptedSwap to override");
  		dbus_g_method_return_error (context, error);
@@ -91,7 +81,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -598,6 +613,7 @@ up_daemon_hibernate (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -598,6 +613,7 @@ up_daemon_hibernate (UpDaemon *daemon, D
  				     UP_DAEMON_ERROR_GENERAL,
  				     "Sleep has already been requested and is pending");
  		dbus_g_method_return_error (context, error);
@@ -99,7 +89,7 @@ index 3fb952b..4884b64 100644
  		goto out;
  	}
  
-@@ -619,13 +635,21 @@ up_daemon_hibernate_allowed (UpDaemon *daemon, DBusGMethodInvocation *context)
+@@ -619,13 +635,21 @@ up_daemon_hibernate_allowed (UpDaemon *d
  	gboolean ret;
  	PolkitSubject *subject = NULL;
  	UpDaemonPrivate *priv = daemon->priv;
@@ -123,10 +113,9 @@ index 3fb952b..4884b64 100644
  
  out:
  	if (subject != NULL)
-diff --git a/src/up-polkit.c b/src/up-polkit.c
-index 9b86394..bd1e5e0 100644
---- a/src/up-polkit.c
-+++ b/src/up-polkit.c
+diff -up upower-0.9.5/src/up-polkit.c.dbus-fixes upower-0.9.5/src/up-polkit.c
+--- upower-0.9.5/src/up-polkit.c.dbus-fixes	2010-08-17 22:14:59.423257004 -0400
++++ upower-0.9.5/src/up-polkit.c	2010-08-17 22:16:35.854257006 -0400
 @@ -52,12 +52,19 @@ static gpointer up_polkit_object = NULL;
  PolkitSubject *
  up_polkit_get_subject (UpPolkit *polkit, DBusGMethodInvocation *context)
@@ -147,19 +136,7 @@ index 9b86394..bd1e5e0 100644
  	return subject;
  }
  
-@@ -79,9 +86,9 @@ up_polkit_check_auth (UpPolkit *polkit, PolkitSubject *subject, const gchar *act
- 							    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);
--		dbus_g_method_return_error (context, error);
-+                dbus_g_method_return_error (context, error);
- 		g_error_free (error_local);
--		g_error_free (error);
-+                g_error_free (error);
- 		goto out;
- 	}
- 
-@@ -90,8 +97,8 @@ up_polkit_check_auth (UpPolkit *polkit, PolkitSubject *subject, const gchar *act
+@@ -88,8 +95,8 @@ up_polkit_check_auth (UpPolkit *polkit, 
  		ret = TRUE;
  	} else {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "not authorized");
@@ -170,7 +147,7 @@ index 9b86394..bd1e5e0 100644
  	}
  out:
  	if (result != NULL)
-@@ -103,10 +110,9 @@ out:
+@@ -101,10 +108,9 @@ out:
   * up_polkit_is_allowed:
   **/
  gboolean
@@ -179,26 +156,25 @@ index 9b86394..bd1e5e0 100644
  {
  	gboolean ret = FALSE;
 -	GError *error;
- 	GError *error_local = NULL;
+ 	GError *error_local;
  	PolkitAuthorizationResult *result;
  
-@@ -116,10 +122,8 @@ up_polkit_is_allowed (UpPolkit *polkit, PolkitSubject *subject, const gchar *act
- 							    POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE,
- 							    NULL, &error_local);
+@@ -112,10 +118,9 @@ up_polkit_is_allowed (UpPolkit *polkit, 
+         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);
--		dbus_g_method_return_error (context, error);
 +		g_set_error (error, UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "failed to check authorisation: %s", error_local->message);
+ 		dbus_g_method_return_error (context, error);
  		g_error_free (error_local);
 -		g_error_free (error);
  		goto out;
  	}
  
-diff --git a/src/up-polkit.h b/src/up-polkit.h
-index acee70e..b9abd7e 100644
---- a/src/up-polkit.h
-+++ b/src/up-polkit.h
-@@ -56,11 +56,11 @@ PolkitSubject	*up_polkit_get_subject		(UpPolkit		*polkit,
+diff -up upower-0.9.5/src/up-polkit.h.dbus-fixes upower-0.9.5/src/up-polkit.h
+--- upower-0.9.5/src/up-polkit.h.dbus-fixes	2010-02-10 12:09:31.000000000 -0500
++++ upower-0.9.5/src/up-polkit.h	2010-08-17 22:14:59.432257004 -0400
+@@ -56,11 +56,11 @@ PolkitSubject	*up_polkit_get_subject		(U
  gboolean	 up_polkit_check_auth		(UpPolkit		*polkit,
  						 PolkitSubject		*subject,
  						 const gchar		*action_id,
@@ -212,11 +188,10 @@ index acee70e..b9abd7e 100644
  gboolean         up_polkit_get_uid		(UpPolkit              *polkit,
                                                   PolkitSubject          *subject,
                                                   uid_t                  *uid);
-diff --git a/src/up-qos.c b/src/up-qos.c
-index 0ce3eea..b36df3f 100644
---- a/src/up-qos.c
-+++ b/src/up-qos.c
-@@ -262,6 +262,7 @@ up_qos_request_latency (UpQos *qos, const gchar *type_text, gint value, gboolean
+diff -up upower-0.9.5/src/up-qos.c.dbus-fixes upower-0.9.5/src/up-qos.c
+--- upower-0.9.5/src/up-qos.c.dbus-fixes	2010-06-05 11:45:18.000000000 -0400
++++ upower-0.9.5/src/up-qos.c	2010-08-17 22:14:59.433257004 -0400
+@@ -262,6 +262,7 @@ up_qos_request_latency (UpQos *qos, cons
  	if (type == UP_QOS_KIND_UNKNOWN) {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text);
  		dbus_g_method_return_error (context, error);
@@ -224,7 +199,7 @@ index 0ce3eea..b36df3f 100644
  		goto out;
  	}
  
-@@ -270,6 +271,7 @@ up_qos_request_latency (UpQos *qos, const gchar *type_text, gint value, gboolean
+@@ -270,6 +271,7 @@ up_qos_request_latency (UpQos *qos, cons
  	if (sender == NULL) {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "no DBUS sender");
  		dbus_g_method_return_error (context, error);
@@ -232,7 +207,7 @@ index 0ce3eea..b36df3f 100644
  		goto out;
  	}
  
-@@ -291,6 +293,7 @@ up_qos_request_latency (UpQos *qos, const gchar *type_text, gint value, gboolean
+@@ -291,6 +293,7 @@ up_qos_request_latency (UpQos *qos, cons
  	if (!retval) {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "cannot get UID");
  		dbus_g_method_return_error (context, error);
@@ -240,7 +215,7 @@ index 0ce3eea..b36df3f 100644
  		goto out;
  	}
  
-@@ -299,6 +302,7 @@ up_qos_request_latency (UpQos *qos, const gchar *type_text, gint value, gboolean
+@@ -299,6 +302,7 @@ up_qos_request_latency (UpQos *qos, cons
  	if (!retval) {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "cannot get PID");
  		dbus_g_method_return_error (context, error);
@@ -248,7 +223,7 @@ index 0ce3eea..b36df3f 100644
  		goto out;
  	}
  
-@@ -307,6 +311,7 @@ up_qos_request_latency (UpQos *qos, const gchar *type_text, gint value, gboolean
+@@ -307,6 +311,7 @@ up_qos_request_latency (UpQos *qos, cons
  	if (cmdline == NULL) {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "cannot get cmdline");
  		dbus_g_method_return_error (context, error);
@@ -256,7 +231,7 @@ index 0ce3eea..b36df3f 100644
  		goto out;
  	}
  
-@@ -359,6 +364,7 @@ up_qos_cancel_request (UpQos *qos, guint cookie, DBusGMethodInvocation *context)
+@@ -359,6 +364,7 @@ up_qos_cancel_request (UpQos *qos, guint
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL,
  				     "Cannot find request for #%i", cookie);
  		dbus_g_method_return_error (context, error);
@@ -264,7 +239,7 @@ index 0ce3eea..b36df3f 100644
  		goto out;
  	}
  
-@@ -367,6 +373,7 @@ up_qos_cancel_request (UpQos *qos, guint cookie, DBusGMethodInvocation *context)
+@@ -367,6 +373,7 @@ up_qos_cancel_request (UpQos *qos, guint
  	if (sender == NULL) {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "no DBUS sender");
  		dbus_g_method_return_error (context, error);
@@ -272,7 +247,7 @@ index 0ce3eea..b36df3f 100644
  		goto out;
  	}
  
-@@ -388,6 +395,8 @@ up_qos_cancel_request (UpQos *qos, guint cookie, DBusGMethodInvocation *context)
+@@ -388,6 +395,8 @@ up_qos_cancel_request (UpQos *qos, guint
  	/* TODO: if persistent remove from datadase */
  
  	g_signal_emit (qos, signals [REQUESTS_CHANGED], 0);
@@ -281,7 +256,7 @@ index 0ce3eea..b36df3f 100644
  out:
  	if (subject != NULL)
  		g_object_unref (subject);
-@@ -430,6 +439,7 @@ up_qos_set_minimum_latency (UpQos *qos, const gchar *type_text, gint value, DBus
+@@ -430,6 +439,7 @@ up_qos_set_minimum_latency (UpQos *qos, 
  	if (type == UP_QOS_KIND_UNKNOWN) {
  		error = g_error_new (UP_DAEMON_ERROR, UP_DAEMON_ERROR_GENERAL, "type invalid: %s", type_text);
  		dbus_g_method_return_error (context, error);


More information about the scm-commits mailing list