|
|
eb81ee |
From d309d278bf298d0fe7241b0c5cf2548e322b80a0 Mon Sep 17 00:00:00 2001
|
|
|
eb81ee |
From: David King <dking@redhat.com>
|
|
|
eb81ee |
Date: Tue, 10 May 2016 13:13:50 +0100
|
|
|
eb81ee |
Subject: [PATCH] Fix renaming files in a password-protected archive
|
|
|
eb81ee |
|
|
|
eb81ee |
When opening a password-protected archive, and renaming a file within,
|
|
|
eb81ee |
the password dialog takes user input, sets the password for the archive
|
|
|
eb81ee |
and then restarts the rename action. As part of doing so, it frees the
|
|
|
eb81ee |
existing action and replaces it with a duplicate. However, pointers to
|
|
|
eb81ee |
fields inside the original (now freed) action struct are used to
|
|
|
eb81ee |
provide the old and new filenames, among other arguments. This leads to
|
|
|
eb81ee |
the file being deleted (although accessing freed memory is undefined,
|
|
|
eb81ee |
so other outcomes are possible).
|
|
|
eb81ee |
|
|
|
eb81ee |
Fix the rename operation by always using the fields from the new
|
|
|
eb81ee |
struct, which exists for the lifetime of the rename action.
|
|
|
eb81ee |
|
|
|
eb81ee |
https://bugzilla.redhat.com/show_bug.cgi?id=1233853
|
|
|
eb81ee |
https://bugzilla.gnome.org/show_bug.cgi?id=766227
|
|
|
eb81ee |
---
|
|
|
eb81ee |
src/fr-window.c | 12 ++++++------
|
|
|
eb81ee |
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
eb81ee |
|
|
|
eb81ee |
diff --git a/src/fr-window.c b/src/fr-window.c
|
|
|
eb81ee |
index fd161b7..1d0a661 100644
|
|
|
eb81ee |
--- a/src/fr-window.c
|
|
|
eb81ee |
+++ b/src/fr-window.c
|
|
|
eb81ee |
@@ -8205,12 +8205,12 @@ rename_selection (FrWindow *window,
|
|
|
eb81ee |
fr_window_clipboard_remove_file_list (window, file_list);
|
|
|
eb81ee |
fr_archive_rename (window->archive,
|
|
|
eb81ee |
file_list,
|
|
|
eb81ee |
- old_name,
|
|
|
eb81ee |
- new_name,
|
|
|
eb81ee |
- current_dir,
|
|
|
eb81ee |
- is_dir,
|
|
|
eb81ee |
- dir_in_archive,
|
|
|
eb81ee |
- original_path,
|
|
|
eb81ee |
+ rdata->old_name,
|
|
|
eb81ee |
+ rdata->new_name,
|
|
|
eb81ee |
+ rdata->current_dir,
|
|
|
eb81ee |
+ rdata->is_dir,
|
|
|
eb81ee |
+ rdata->dir_in_archive,
|
|
|
eb81ee |
+ rdata->original_path,
|
|
|
eb81ee |
window->priv->cancellable,
|
|
|
eb81ee |
archive_rename_ready_cb,
|
|
|
eb81ee |
window);
|
|
|
eb81ee |
--
|
|
|
eb81ee |
2.8.2
|
|
|
eb81ee |
|