[gnome-autoar] extractor: Show password prompt only for ZIP



commit 8de50352fe3044c2e6754eec86816faff7513f6d
Author: Ignacy KuchciƄski <ignacykuchcinski gmail com>
Date:   Thu Jan 27 18:33:44 2022 +0100

    extractor: Show password prompt only for ZIP
    
    Currently, when trying to extract password protected 7z archives that
    don't have encrypted file lists, password prompt will be shown, even
    though the extraction itself will fail.
    
    To fix this situation, ensure that the archive format is supported ZIP
    before showing the password prompt.

 gnome-autoar/autoar-extractor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c
index cbf42bd..6064172 100644
--- a/gnome-autoar/autoar-extractor.c
+++ b/gnome-autoar/autoar-extractor.c
@@ -1684,7 +1684,8 @@ autoar_extractor_step_scan_toplevel (AutoarExtractor *self)
       return;
     }
 
-    if (archive_entry_is_encrypted (entry)) {
+    if (archive_entry_is_encrypted (entry) &&
+        archive_format (a) == ARCHIVE_FORMAT_ZIP) {
       autoar_extractor_request_passphrase (self);
       if (g_cancellable_is_cancelled (self->cancellable)) {
         archive_read_free (a);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]