[gnome-autoar] AutoarExtractor: signal error on encrypted archives



commit 2ea62d25db62852141e5266c6ce5a4a26f41f516
Author: Razvan Chitu <razvan ch95 gmail com>
Date:   Tue Aug 30 18:41:21 2016 +0300

    AutoarExtractor: signal error on encrypted archives
    
    Libarchive does not yet support decryption for all archive formats, so for now
    an error should be signalled when encrypted headers are encountered. Proceeding
    to decompress an encrypted file would end up in either creating empty files or
    getting an error from libarchive.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770606

 gnome-autoar/autoar-extractor.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gnome-autoar/autoar-extractor.c b/gnome-autoar/autoar-extractor.c
index 96a14cc..396d131 100644
--- a/gnome-autoar/autoar-extractor.c
+++ b/gnome-autoar/autoar-extractor.c
@@ -1588,6 +1588,16 @@ autoar_extractor_step_scan_toplevel (AutoarExtractor *self)
       return;
     }
 
+    if (archive_entry_is_encrypted (entry)) {
+      if (self->error == NULL) {
+        self->error = g_error_new (G_IO_ERROR,
+                                   G_IO_ERROR_NOT_SUPPORTED,
+                                   "Encrypted archives are not supported.");
+      }
+      archive_read_free (a);
+      return;
+    }
+
     pathname = archive_entry_pathname (entry);
     g_debug ("autoar_extractor_step_scan_toplevel: %d: pathname = %s",
              self->total_files, pathname);


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