summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-11-24 00:18:27 +0100
committerPablo Barciela <[email protected]>2017-11-24 00:31:00 +0100
commit516bd1a9d6003711b0ba42e3dcd233997f6cf777 (patch)
tree0e68283037914473acff874b2fab3dafd4f9963b /src
parent0e6079315b01541485af08ab82160e02775c613d (diff)
downloadengrampa-516bd1a9d6003711b0ba42e3dcd233997f6cf777.tar.bz2
engrampa-516bd1a9d6003711b0ba42e3dcd233997f6cf777.tar.xz
7z: Fix: rename files with password without the list encrypted
Diffstat (limited to 'src')
-rw-r--r--src/fr-command-7z.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index ffccc94..a41f97d 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -39,8 +39,11 @@
static void fr_command_7z_class_init (FrCommand7zClass *class);
static void fr_command_7z_init (FrCommand *afile);
static void fr_command_7z_finalize (GObject *object);
+
static gboolean spd_support = FALSE;
static gboolean unexpected_end_of_archive = FALSE;
+static gboolean password_required = FALSE;
+static gboolean password_handled = FALSE;
/* Parent Class */
@@ -225,6 +228,7 @@ add_password_arg (FrCommand *comm,
arg = g_strconcat ("-p", password, NULL);
fr_process_add_arg (comm->process, arg);
g_free (arg);
+ password_handled = TRUE;
}
}
@@ -284,6 +288,9 @@ process_line__add (char *line,
{
FrCommand *comm = FR_COMMAND (data);
+ if (strstr (line, "Enter password") != NULL)
+ password_required = TRUE;
+
if ((comm->volume_size > 0) && (strncmp (line, "Creating archive", 16) == 0)) {
char *volume_filename;
GFile *volume_file;
@@ -550,6 +557,12 @@ fr_command_7z_handle_error (FrCommand *comm,
error->type = FR_PROC_ERROR_NONE;
}
else {
+ if (password_required && (!password_handled))
+ {
+ error->type = FR_PROC_ERROR_ASK_PASSWORD;
+ return;
+ }
+
GList *scan;
for (scan = g_list_last (comm->process->out.raw); scan; scan = scan->prev) {