ssuominen    14/03/14 13:40:16

  Added:                upower-0.9.23-fix-segfault.patch
                        upower-0.9.23-create-dir-runtime.patch
  Log:
  Create the history directory in /var at runtime. Fix segmentation fault. 
Since it might take a while 0.99.0 can be keyworded.
  
  (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 
4868F14D)

Revision  Changes    Path
1.1                  sys-power/upower/files/upower-0.9.23-fix-segfault.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/upower/files/upower-0.9.23-fix-segfault.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/upower/files/upower-0.9.23-fix-segfault.patch?rev=1.1&content-type=text/plain

Index: upower-0.9.23-fix-segfault.patch
===================================================================
>From 0d64bbddaa0078ef148d609a3cfad854cf00d7de Mon Sep 17 00:00:00 2001
From: Martin Pitt <[email protected]>
Date: Fri, 08 Nov 2013 13:59:50 +0000
Subject: lib: Fix segfault on getting property when daemon is not running

This fixes "upower --version" when the daemon is not running, and thus the
client proxy is NULL.
---
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
index 35d7b5d..17fb02d 100644
--- a/libupower-glib/up-client.c
+++ b/libupower-glib/up-client.c
@@ -322,6 +322,9 @@ up_client_get_property (GObject *object,
        UpClient *client;
        client = UP_CLIENT (object);
 
+       if (client->priv->proxy == NULL)
+                return;
+
        switch (prop_id) {
        case PROP_DAEMON_VERSION:
                g_value_set_string (value, up_client_glue_get_daemon_version 
(client->priv->proxy));
--
cgit v0.9.0.2-2-gbebe



1.1                  
sys-power/upower/files/upower-0.9.23-create-dir-runtime.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/upower/files/upower-0.9.23-create-dir-runtime.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/upower/files/upower-0.9.23-create-dir-runtime.patch?rev=1.1&content-type=text/plain

Index: upower-0.9.23-create-dir-runtime.patch
===================================================================
>From b9cff29978113aefe3ad18521f383f12ab099a34 Mon Sep 17 00:00:00 2001
From: Cosimo Cecchi <[email protected]>
Date: Tue, 25 Feb 2014 09:43:04 +0000
Subject: Create the history directory at runtime

In addition to build time - this increases compatibilty with OSTree,
which starts out with an empty /var.

Signed-off-by: Richard Hughes <[email protected]>
---
diff --git a/src/up-history.c b/src/up-history.c
index f9d0fdf..795b093 100644
--- a/src/up-history.c
+++ b/src/up-history.c
@@ -414,6 +414,7 @@ up_history_set_directory (UpHistory *history, const gchar 
*dir)
 {
        g_free (history->priv->dir);
        history->priv->dir = g_strdup (dir);
+       g_mkdir_with_parents (dir, 0755);
 }
 
 /**
@@ -887,7 +888,8 @@ up_history_init (UpHistory *history)
        history->priv->data_time_full = g_ptr_array_new_with_free_func 
((GDestroyNotify) g_object_unref);
        history->priv->data_time_empty = g_ptr_array_new_with_free_func 
((GDestroyNotify) g_object_unref);
        history->priv->max_data_age = UP_HISTORY_DEFAULT_MAX_DATA_AGE;
-       history->priv->dir = g_build_filename (HISTORY_DIR, NULL);
+
+       up_history_set_directory (history, HISTORY_DIR);
 }
 
 /**
--
cgit v0.9.0.2-2-gbebe




Reply via email to