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

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