Blame SOURCES/0159-wizard-fix-save-users-changes-after-reviewing-dump-d.patch

28bab8
From 46d7cc6b317334cdd119ceaec9887eab0afac39c Mon Sep 17 00:00:00 2001
28bab8
From: Matej Habrnal <mhabrnal@redhat.com>
28bab8
Date: Mon, 12 Oct 2015 09:14:12 +0200
28bab8
Subject: [PATCH] wizard: fix save users changes after reviewing dump dir files
28bab8
28bab8
If the user reviewed the dump dir's files during reporting the crash, the
28bab8
changes was thrown away and original data was passed to the bugzilla bug
28bab8
report.
28bab8
28bab8
report-gtk saves the first text view buffer and then reloads data from the
28bab8
reported problem directory, which causes that the changes made to those text
28bab8
views are thrown away.
28bab8
28bab8
Function save_text_if_changed(), except of saving text, also reload the files
28bab8
from dump dir and update gui state from the dump dir. The commit moves the
28bab8
reloading and updating gui functions away from this function.
28bab8
28bab8
Related to rhbz#1270235
28bab8
28bab8
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
28bab8
28bab8
Resolves: CVE-2015-5302
28bab8
28bab8
Signed-off-by: Jakub Filak <jfilak@redhat.com>
28bab8
---
28bab8
 src/gui-wizard-gtk/wizard.c | 9 ++++++---
28bab8
 1 file changed, 6 insertions(+), 3 deletions(-)
28bab8
28bab8
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
28bab8
index 71964a9..3a7db9c 100644
28bab8
--- a/src/gui-wizard-gtk/wizard.c
28bab8
+++ b/src/gui-wizard-gtk/wizard.c
28bab8
@@ -495,8 +495,6 @@ static void save_text_if_changed(const char *name, const char *new_value)
28bab8
 
28bab8
 //FIXME: else: what to do with still-unsaved data in the widget??
28bab8
         dd_close(dd);
28bab8
-        problem_data_reload_from_dump_dir();
28bab8
-        update_gui_state_from_problem_data(/* don't update selected event */ 0);
28bab8
     }
28bab8
 }
28bab8
 
28bab8
@@ -839,7 +837,11 @@ static void tv_details_row_activated(
28bab8
         load_text_to_text_view(GTK_TEXT_VIEW(textview), item_name);
28bab8
 
28bab8
         if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK)
28bab8
+        {
28bab8
             save_text_from_text_view(GTK_TEXT_VIEW(textview), item_name);
28bab8
+            problem_data_reload_from_dump_dir();
28bab8
+            update_gui_state_from_problem_data(/* don't update selected event */ 0);
28bab8
+        }
28bab8
 
28bab8
         gtk_widget_destroy(textview);
28bab8
         gtk_widget_destroy(scrolled);
28bab8
@@ -2662,7 +2664,8 @@ static void on_page_prepare(GtkNotebook *assistant, GtkWidget *page, gpointer us
28bab8
      * these tabs will be lost */
28bab8
     save_items_from_notepad();
28bab8
     save_text_from_text_view(g_tv_comment, FILENAME_COMMENT);
28bab8
-
28bab8
+    problem_data_reload_from_dump_dir();
28bab8
+    update_gui_state_from_problem_data(/* don't update selected event */ 0);
28bab8
 
28bab8
     if (pages[PAGENO_SUMMARY].page_widget == page)
28bab8
     {
28bab8
-- 
28bab8
1.8.3.1
28bab8