Tags: patch

I believe i have found a solution to avoid these freezes. It seems the
affected function is xa_treeview_row_activated in src/window.c.

This function is responsible for displaying selected files within the
treeview which have been double-clicked by the user. Unfortunately there
is no safe handling of password protected / encrypted files. To avoid
freezing of the application a solution would be to check whether a file
is encrypted and if the correct password was given. If not, nothing will
happen by double-clicking on a file.

To unlock the content of the archive, the user needs to use the popupmenu
(right-click) and enter the password while using the view or extract dialog.

Another option to unlock the files is to use the "Enter password" menu entry.

Once unlocked, the files will also be accessible by double-clicking on them.
From: Markus Koschany <a...@gambaru.de>
Date: Tue, 5 Mar 2013 19:12:19 +0100
Subject: check for password protected files on double-click

You can view content of files if you double click on them in xarchiver's
treeview. This patch checks for password protected files which cannot be
viewed unless the password has been provided by the user.

If no valid password is detected, xarchiver will refuse to display them, which
otherwise could lead to a complete freeze of the application.

Bug: http://bugs.debian.org/633598
---
 src/window.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/window.c b/src/window.c
index d8571b1..00abc59 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2757,6 +2757,12 @@ void xa_treeview_row_activated(GtkTreeView *tree_view,GtkTreePath *path,GtkTreeV
 	/* The selected entry it's not a dir so extract it to the tmp dir and send it to xa_determine_program_to_run() */
 	else
 	{
+		if (entry->is_encrypted)
+		{
+		  if (archive->passwd == NULL)
+		     return;
+		}
+
 	   	if (archive->extraction_path)
 	   	{
 	   		dummy = g_strdup(archive->extraction_path);

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to