diff options
author | Pablo Barciela <[email protected]> | 2017-11-24 00:18:27 +0100 |
---|---|---|
committer | monsta <[email protected]> | 2017-11-26 20:17:44 +0300 |
commit | 26a96d66550ffe3e634ae6655519da424c737c53 (patch) | |
tree | c651fb1c5abaca09b089364388b40c41fa6e3338 | |
parent | 30c7a5b0f857c0a5fb5ea327fe064d4cfab58fba (diff) | |
download | engrampa-26a96d66550ffe3e634ae6655519da424c737c53.tar.bz2 engrampa-26a96d66550ffe3e634ae6655519da424c737c53.tar.xz |
7z: Fix: rename files with password without the list encrypted
-rw-r--r-- | src/fr-command-7z.c | 13 |
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) { |