Update to 2.12.0
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
This commit is contained in:
parent
ebf644594c
commit
c7b20eb399
1
.gitignore
vendored
1
.gitignore
vendored
@ -64,3 +64,4 @@ abrt-1.1.13.tar.gz
|
||||
/abrt-2.10.10.tar.gz
|
||||
/abrt-2.11.0.tar.gz
|
||||
/abrt-2.11.1.tar.gz
|
||||
/abrt-2.12.0.tar.gz
|
||||
|
@ -1,299 +0,0 @@
|
||||
From 21bdee77727417b6b16feed7b466953873319b58 Mon Sep 17 00:00:00 2001
|
||||
From: Ernestas Kulik <ekulik@redhat.com>
|
||||
Date: Tue, 8 Jan 2019 14:26:15 +0100
|
||||
Subject: [PATCH] dbus: task: Use modern GLib type macros
|
||||
|
||||
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
|
||||
---
|
||||
src/dbus/abrt_problems2_task.c | 111 ++++++++++++++++++++++++---------
|
||||
src/dbus/abrt_problems2_task.h | 26 +-------
|
||||
2 files changed, 82 insertions(+), 55 deletions(-)
|
||||
|
||||
diff --git a/src/dbus/abrt_problems2_task.c b/src/dbus/abrt_problems2_task.c
|
||||
index f40381f6..cba6b469 100644
|
||||
--- a/src/dbus/abrt_problems2_task.c
|
||||
+++ b/src/dbus/abrt_problems2_task.c
|
||||
@@ -25,6 +25,15 @@ enum {
|
||||
|
||||
static guint s_signals[SN_LAST_SIGNAL] = { 0 };
|
||||
|
||||
+struct _AbrtP2TaskPrivate
|
||||
+{
|
||||
+ gint32 p2t_status;
|
||||
+ GVariant *p2t_details;
|
||||
+ GVariant *p2t_results;
|
||||
+ gint32 p2t_code;
|
||||
+ GCancellable *p2t_cancellable;
|
||||
+};
|
||||
+
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(AbrtP2Task, abrt_p2_task, G_TYPE_OBJECT)
|
||||
|
||||
static void abrt_p2_task_finalize(GObject *gobject)
|
||||
@@ -74,17 +83,24 @@ static void abrt_p2_task_class_init(AbrtP2TaskClass *klass)
|
||||
|
||||
static void abrt_p2_task_init(AbrtP2Task *self)
|
||||
{
|
||||
- self->pv = abrt_p2_task_get_instance_private(self);
|
||||
- self->pv->p2t_details = g_variant_new("a{sv}", NULL);
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(self);
|
||||
+
|
||||
+ pv->p2t_details = g_variant_new("a{sv}", NULL);
|
||||
}
|
||||
|
||||
static void abrt_p2_task_change_status(AbrtP2Task *task,
|
||||
AbrtP2TaskStatus status)
|
||||
{
|
||||
- if (task->pv->p2t_status == status)
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ if (pv->p2t_status == status)
|
||||
return;
|
||||
|
||||
- task->pv->p2t_status = status;
|
||||
+ pv->p2t_status = status;
|
||||
|
||||
g_signal_emit(task,
|
||||
s_signals[SN_STATUS_CHANGED],
|
||||
@@ -94,53 +110,77 @@ static void abrt_p2_task_change_status(AbrtP2Task *task,
|
||||
|
||||
AbrtP2TaskStatus abrt_p2_task_status(AbrtP2Task *task)
|
||||
{
|
||||
- return task->pv->p2t_status;
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ return pv->p2t_status;
|
||||
}
|
||||
|
||||
GVariant *abrt_p2_task_details(AbrtP2Task *task)
|
||||
{
|
||||
- return g_variant_ref(task->pv->p2t_details);
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ return g_variant_ref(pv->p2t_details);
|
||||
}
|
||||
|
||||
void abrt_p2_task_add_detail(AbrtP2Task *task,
|
||||
const char *key,
|
||||
GVariant *value)
|
||||
{
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
GVariantDict dict;
|
||||
- g_variant_dict_init(&dict, task->pv->p2t_details);
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ g_variant_dict_init(&dict, pv->p2t_details);
|
||||
g_variant_dict_insert(&dict, key, "v", value);
|
||||
|
||||
- if (task->pv->p2t_details)
|
||||
- g_variant_unref(task->pv->p2t_details);
|
||||
+ if (pv->p2t_details)
|
||||
+ g_variant_unref(pv->p2t_details);
|
||||
|
||||
- task->pv->p2t_details = g_variant_dict_end(&dict);
|
||||
+ pv->p2t_details = g_variant_dict_end(&dict);
|
||||
}
|
||||
|
||||
void abrt_p2_task_set_response(AbrtP2Task *task,
|
||||
GVariant *response)
|
||||
{
|
||||
- if (task->pv->p2t_results != NULL)
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ if (pv->p2t_results != NULL)
|
||||
log_warning("Task already has response assigned");
|
||||
|
||||
- task->pv->p2t_results = response;
|
||||
+ pv->p2t_results = response;
|
||||
}
|
||||
|
||||
bool abrt_p2_task_is_cancelled(AbrtP2Task *task)
|
||||
{
|
||||
- return (task->pv->p2t_cancellable
|
||||
- && g_cancellable_is_cancelled(task->pv->p2t_cancellable))
|
||||
- || task->pv->p2t_status == ABRT_P2_TASK_STATUS_CANCELED;
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ return (pv->p2t_cancellable
|
||||
+ && g_cancellable_is_cancelled(pv->p2t_cancellable))
|
||||
+ || pv->p2t_status == ABRT_P2_TASK_STATUS_CANCELED;
|
||||
}
|
||||
|
||||
void abrt_p2_task_cancel(AbrtP2Task *task,
|
||||
GError **error)
|
||||
{
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
if (abrt_p2_task_is_cancelled(task))
|
||||
return;
|
||||
|
||||
- if (task->pv->p2t_status == ABRT_P2_TASK_STATUS_RUNNING)
|
||||
- g_cancellable_cancel(task->pv->p2t_cancellable);
|
||||
- else if (task->pv->p2t_status == ABRT_P2_TASK_STATUS_STOPPED)
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ if (pv->p2t_status == ABRT_P2_TASK_STATUS_RUNNING)
|
||||
+ g_cancellable_cancel(pv->p2t_cancellable);
|
||||
+ else if (pv->p2t_status == ABRT_P2_TASK_STATUS_STOPPED)
|
||||
{
|
||||
ABRT_P2_TASK_VIRTUAL_CANCEL(task, error);
|
||||
|
||||
@@ -157,8 +197,12 @@ void abrt_p2_task_finish(AbrtP2Task *task,
|
||||
gint32 *code,
|
||||
GError **error)
|
||||
{
|
||||
- if ( task->pv->p2t_status != ABRT_P2_TASK_STATUS_DONE
|
||||
- && task->pv->p2t_status != ABRT_P2_TASK_STATUS_FAILED)
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ if ( pv->p2t_status != ABRT_P2_TASK_STATUS_DONE
|
||||
+ && pv->p2t_status != ABRT_P2_TASK_STATUS_FAILED)
|
||||
{
|
||||
g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
|
||||
"Cannot finalize undone task");
|
||||
@@ -170,12 +214,12 @@ void abrt_p2_task_finish(AbrtP2Task *task,
|
||||
if (*error != NULL)
|
||||
return;
|
||||
|
||||
- if (task->pv->p2t_results)
|
||||
- *result = g_variant_ref(task->pv->p2t_results);
|
||||
+ if (pv->p2t_results)
|
||||
+ *result = g_variant_ref(pv->p2t_results);
|
||||
else
|
||||
*result = g_variant_new("a{sv}", NULL);
|
||||
|
||||
- *code = task->pv->p2t_code;
|
||||
+ *code = pv->p2t_code;
|
||||
}
|
||||
|
||||
static void abrt_p2_task_finish_gtask(GObject *source_object,
|
||||
@@ -183,6 +227,7 @@ static void abrt_p2_task_finish_gtask(GObject *source_object,
|
||||
gpointer user_data)
|
||||
{
|
||||
AbrtP2Task *task = ABRT_P2_TASK(source_object);
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
|
||||
if (!g_task_is_valid(result, task))
|
||||
{
|
||||
@@ -190,6 +235,8 @@ static void abrt_p2_task_finish_gtask(GObject *source_object,
|
||||
return;
|
||||
}
|
||||
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
GError *error = NULL;
|
||||
const gint32 code = g_task_propagate_int(G_TASK(result), &error);
|
||||
|
||||
@@ -203,7 +250,7 @@ static void abrt_p2_task_finish_gtask(GObject *source_object,
|
||||
{
|
||||
log_debug("Task done");
|
||||
|
||||
- task->pv->p2t_code = code - ABRT_P2_TASK_CODE_DONE;
|
||||
+ pv->p2t_code = code - ABRT_P2_TASK_CODE_DONE;
|
||||
abrt_p2_task_change_status(task, ABRT_P2_TASK_STATUS_DONE);
|
||||
}
|
||||
else if (abrt_p2_task_is_cancelled(task))
|
||||
@@ -263,8 +310,8 @@ static void abrt_p2_task_finish_gtask(GObject *source_object,
|
||||
abrt_p2_task_change_status(task, ABRT_P2_TASK_STATUS_FAILED);
|
||||
}
|
||||
|
||||
- g_object_unref(task->pv->p2t_cancellable);
|
||||
- task->pv->p2t_cancellable = NULL;
|
||||
+ g_object_unref(pv->p2t_cancellable);
|
||||
+ pv->p2t_cancellable = NULL;
|
||||
}
|
||||
|
||||
static void abrt_p2_task_thread(GTask *task,
|
||||
@@ -289,8 +336,12 @@ void abrt_p2_task_start(AbrtP2Task *task,
|
||||
GVariant *options,
|
||||
GError **error)
|
||||
{
|
||||
- if ( task->pv->p2t_status != ABRT_P2_TASK_STATUS_NEW
|
||||
- && task->pv->p2t_status != ABRT_P2_TASK_STATUS_STOPPED)
|
||||
+ AbrtP2TaskPrivate *pv;
|
||||
+
|
||||
+ pv = abrt_p2_task_get_instance_private(task);
|
||||
+
|
||||
+ if ( pv->p2t_status != ABRT_P2_TASK_STATUS_NEW
|
||||
+ && pv->p2t_status != ABRT_P2_TASK_STATUS_STOPPED)
|
||||
{
|
||||
g_set_error(error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
|
||||
"Cannot start task that is not new or stopped");
|
||||
@@ -302,9 +353,9 @@ void abrt_p2_task_start(AbrtP2Task *task,
|
||||
if (*error != NULL)
|
||||
return;
|
||||
|
||||
- task->pv->p2t_cancellable = g_cancellable_new();
|
||||
+ pv->p2t_cancellable = g_cancellable_new();
|
||||
GTask *gtask = g_task_new(task,
|
||||
- task->pv->p2t_cancellable,
|
||||
+ pv->p2t_cancellable,
|
||||
abrt_p2_task_finish_gtask,
|
||||
NULL);
|
||||
|
||||
diff --git a/src/dbus/abrt_problems2_task.h b/src/dbus/abrt_problems2_task.h
|
||||
index 71f765d9..717af47b 100644
|
||||
--- a/src/dbus/abrt_problems2_task.h
|
||||
+++ b/src/dbus/abrt_problems2_task.h
|
||||
@@ -45,21 +45,12 @@ G_BEGIN_DECLS
|
||||
GType abrt_p2_task_get_type (void);
|
||||
|
||||
#define ABRT_TYPE_P2_TASK (abrt_p2_task_get_type ())
|
||||
-#define ABRT_P2_TASK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ABRT_TYPE_P2_TASK, AbrtP2Task))
|
||||
-#define ABRT_P2_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ABRT_TYPE_P2_TASK, AbrtP2TaskClass))
|
||||
-#define ABRT_IS_P2_TASK(obj)(G_TYPE_CHECK_INSTANCE_TYPE ((obj), ABRT_TYPE_P2_TASK))
|
||||
-#define ABRT_IS_P2_TASK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ABRT_TYPE_P2_TASK))
|
||||
-#define ABRT_P2_TASK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ABRT_TYPE_P2_TASK, AbrtP2TaskClass))
|
||||
+G_DECLARE_DERIVABLE_TYPE(AbrtP2Task, abrt_p2_task, ABRT, P2_TASK, GObject)
|
||||
|
||||
typedef struct _AbrtP2Task AbrtP2Task;
|
||||
typedef struct _AbrtP2TaskClass AbrtP2TaskClass;
|
||||
typedef struct _AbrtP2TaskPrivate AbrtP2TaskPrivate;
|
||||
|
||||
-static inline void glib_autoptr_cleanup_AbrtP2Task(AbrtP2Task **task)
|
||||
-{
|
||||
- glib_autoptr_cleanup_GObject((GObject **)task);
|
||||
-}
|
||||
-
|
||||
typedef enum {
|
||||
ABRT_P2_TASK_STATUS_NEW,
|
||||
ABRT_P2_TASK_STATUS_RUNNING,
|
||||
@@ -96,21 +87,6 @@ struct _AbrtP2TaskClass
|
||||
gpointer padding[12];
|
||||
};
|
||||
|
||||
-struct _AbrtP2TaskPrivate
|
||||
-{
|
||||
- gint32 p2t_status;
|
||||
- GVariant *p2t_details;
|
||||
- GVariant *p2t_results;
|
||||
- gint32 p2t_code;
|
||||
- GCancellable *p2t_cancellable;
|
||||
-};
|
||||
-
|
||||
-struct _AbrtP2Task
|
||||
-{
|
||||
- GObject parent_instance;
|
||||
- AbrtP2TaskPrivate *pv;
|
||||
-};
|
||||
-
|
||||
AbrtP2TaskStatus abrt_p2_task_status(AbrtP2Task *task);
|
||||
|
||||
/* Returns task details in form of key-value entries.
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,38 +0,0 @@
|
||||
From cf78b299371995cbd7607a536f4b1469c09b40cf Mon Sep 17 00:00:00 2001
|
||||
From: Ernestas Kulik <ekulik@redhat.com>
|
||||
Date: Sat, 12 Jan 2019 10:50:24 +0100
|
||||
Subject: [PATCH] applet: application: Fix use after free
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
dirlist_name is erroneously freed before it’s used to create a
|
||||
directory.
|
||||
|
||||
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1665521
|
||||
|
||||
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
|
||||
---
|
||||
src/applet/abrt-applet-application.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/applet/abrt-applet-application.c b/src/applet/abrt-applet-application.c
|
||||
index 6e7ac00a..4b1d9a3c 100644
|
||||
--- a/src/applet/abrt-applet-application.c
|
||||
+++ b/src/applet/abrt-applet-application.c
|
||||
@@ -296,10 +296,10 @@ new_dir_exists (GList **new_dirs)
|
||||
cachedir = g_get_user_cache_dir ();
|
||||
dirlist_name = concat_path_file (cachedir, "abrt");
|
||||
|
||||
- g_free (dirlist_name);
|
||||
-
|
||||
g_mkdir_with_parents (dirlist_name, 0777);
|
||||
|
||||
+ g_free (dirlist_name);
|
||||
+
|
||||
dirlist_name = concat_path_file (cachedir, "abrt/applet_dirlist");
|
||||
fp = fopen (dirlist_name, "r+");
|
||||
if (fp == NULL)
|
||||
--
|
||||
2.20.1
|
||||
|
19
abrt.spec
19
abrt.spec
@ -52,15 +52,11 @@
|
||||
|
||||
Summary: Automatic bug detection and reporting tool
|
||||
Name: abrt
|
||||
Version: 2.11.1
|
||||
Release: 5%{?dist}
|
||||
Version: 2.12.0
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2+
|
||||
URL: https://abrt.readthedocs.org/
|
||||
Source: https://github.com/abrt/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||
# With new glib it is not possible to build in rawhide
|
||||
# https://github.com/abrt/abrt/commit/21bdee7
|
||||
Patch0: 0001-dbus-task-Use-modern-GLib-type-macros.patch
|
||||
Patch1: 0002-applet-application-Fix-use-after-free.patch
|
||||
BuildRequires: %{dbus_devel}
|
||||
BuildRequires: hostname
|
||||
BuildRequires: gtk3-devel
|
||||
@ -603,11 +599,13 @@ to the shell
|
||||
|
||||
|
||||
%build
|
||||
autoconf
|
||||
|
||||
%define var_base_dir spool
|
||||
|
||||
CFLAGS="%{optflags} -Werror" %configure \
|
||||
./gen-version
|
||||
autoreconf -if
|
||||
intltoolize --automake -c -f
|
||||
|
||||
%configure \
|
||||
%if %{without python2}
|
||||
--without-python2 \
|
||||
%endif # with python2
|
||||
@ -1236,6 +1234,9 @@ killall abrt-dbus >/dev/null 2>&1 || :
|
||||
%config(noreplace) %{_sysconfdir}/profile.d/abrt-console-notification.sh
|
||||
|
||||
%changelog
|
||||
* Mon Feb 4 2019 Ernestas Kulik <ekulik@redhat.com> - 2.12.0-1
|
||||
- Update to 2.12.0
|
||||
|
||||
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.11.1-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (abrt-2.11.1.tar.gz) = d2388bb1123e50ef1c8875e2feeeb8ab6830035e13362fe4f30b39207454c866a0c80412deef05e109814f42efc0c2d51eed4ee3fdc468f4b8eb340acff96226
|
||||
SHA512 (abrt-2.12.0.tar.gz) = 3567332399cd9708505a6d05c9388c7da5c14c7432e6fd40e5e76b6bcea8859c17b3b6c52a96ce54740e3682d75d8bf77dbc5fede80bd4fc6f72c60014f9cded
|
||||
|
Loading…
Reference in New Issue
Block a user