diff -Nru gnome-autoar-0.4.2/debian/changelog gnome-autoar-0.4.3/debian/changelog --- gnome-autoar-0.4.2/debian/changelog 2022-01-16 13:12:07.000000000 +0000 +++ gnome-autoar-0.4.3/debian/changelog 2022-02-11 13:19:21.000000000 +0000 @@ -1,3 +1,10 @@ +gnome-autoar (0.4.3-1) unstable; urgency=medium + + * New upstream release + * Bump Standards-Version to 4.6.0 + + -- Jeremy Bicha Fri, 11 Feb 2022 08:19:21 -0500 + gnome-autoar (0.4.2-1) unstable; urgency=medium * New upstream release diff -Nru gnome-autoar-0.4.2/debian/control gnome-autoar-0.4.3/debian/control --- gnome-autoar-0.4.2/debian/control 2022-01-16 13:12:07.000000000 +0000 +++ gnome-autoar-0.4.3/debian/control 2022-02-11 13:19:21.000000000 +0000 @@ -19,7 +19,7 @@ libarchive-dev (>= 3.4.0), valac Rules-Requires-Root: no -Standards-Version: 4.5.0 +Standards-Version: 4.6.0 Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-autoar Vcs-Git: https://salsa.debian.org/gnome-team/gnome-autoar.git diff -Nru gnome-autoar-0.4.2/debian/control.in gnome-autoar-0.4.3/debian/control.in --- gnome-autoar-0.4.2/debian/control.in 2022-01-16 13:12:07.000000000 +0000 +++ gnome-autoar-0.4.3/debian/control.in 2022-02-11 13:19:21.000000000 +0000 @@ -15,7 +15,7 @@ libarchive-dev (>= 3.4.0), valac Rules-Requires-Root: no -Standards-Version: 4.5.0 +Standards-Version: 4.6.0 Vcs-Browser: https://salsa.debian.org/gnome-team/gnome-autoar Vcs-Git: https://salsa.debian.org/gnome-team/gnome-autoar.git diff -Nru gnome-autoar-0.4.2/gnome-autoar/autoar-extractor.c gnome-autoar-0.4.3/gnome-autoar/autoar-extractor.c --- gnome-autoar-0.4.2/gnome-autoar/autoar-extractor.c 2022-01-07 09:49:41.690870500 +0000 +++ gnome-autoar-0.4.3/gnome-autoar/autoar-extractor.c 2022-02-11 08:37:04.640689600 +0000 @@ -97,7 +97,6 @@ #define BUFFER_SIZE (64 * 1024) #define NOT_AN_ARCHIVE_ERRNO 2013 #define EMPTY_ARCHIVE_ERRNO 2014 -#define INCORRECT_PASSPHRASE_ERRNO 2015 typedef struct _GFileAndInfo GFileAndInfo; @@ -992,11 +991,13 @@ { GFile *parent; parent = g_file_get_parent (dest); - if (parent && !g_file_query_exists (parent, self->cancellable)) - g_file_make_directory_with_parents (parent, - self->cancellable, - NULL); - g_object_unref (parent); + if (parent) { + if (!g_file_query_exists (parent, self->cancellable)) + g_file_make_directory_with_parents (parent, + self->cancellable, + NULL); + g_object_unref (parent); + } } info = g_file_info_new (); @@ -1172,12 +1173,9 @@ autoar_extractor_signal_progress (self); } - if (r == ARCHIVE_FAILED) { + if (r != ARCHIVE_EOF) { if (self->error == NULL) { - self->error = g_error_new (AUTOAR_EXTRACTOR_ERROR, - INCORRECT_PASSPHRASE_ERRNO, - "%s", - archive_error_string (a)); + self->error = autoar_common_g_error_new_a (a, NULL); } g_output_stream_close (ostream, self->cancellable, NULL); g_object_unref (ostream); @@ -1658,18 +1656,16 @@ r = libarchive_create_read_object (TRUE, self, &a); if (r != ARCHIVE_OK) { if (self->error == NULL) - self->error = autoar_common_g_error_new_a (a, self->source_basename); + self->error = autoar_common_g_error_new_a (a, NULL); return; } else if (archive_filter_count (a) <= 1){ /* If we only use raw format and filter count is one, libarchive will * not do anything except for just copying the source file. We do not * want this thing to happen because it does unnecesssary copying. */ if (self->error == NULL) - self->error = g_error_new (AUTOAR_EXTRACTOR_ERROR, - NOT_AN_ARCHIVE_ERRNO, - "\'%s\': %s", - self->source_basename, - "not an archive"); + self->error = g_error_new_literal (AUTOAR_EXTRACTOR_ERROR, + NOT_AN_ARCHIVE_ERRNO, + "not an archive"); return; } self->use_raw_format = TRUE; @@ -1688,7 +1684,14 @@ return; } - if (archive_entry_is_encrypted (entry)) { + /* The password is requested only for the ZIP format to avoid showing + * password prompt for 7ZIP/RAR, where archive_entry_is_encrypted resp. + * archive_entry_is_metadata_encrypted returns TRUE, but followup + * archive_read_data_block resp. archive_read_next_header call leads to + * an error. See https://github.com/libarchive/libarchive/issues/1662. + */ + 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); @@ -1725,22 +1728,19 @@ archive_read_data_skip (a); } - if (self->files_list == NULL) { + if (r != ARCHIVE_EOF) { if (self->error == NULL) { - self->error = g_error_new (AUTOAR_EXTRACTOR_ERROR, - EMPTY_ARCHIVE_ERRNO, - "\'%s\': %s", - self->source_basename, - "empty archive"); + self->error = autoar_common_g_error_new_a (a, NULL); } archive_read_free (a); return; } - if (r != ARCHIVE_EOF) { + if (self->files_list == NULL) { if (self->error == NULL) { - self->error = - autoar_common_g_error_new_a (a, self->source_basename); + self->error = g_error_new_literal (AUTOAR_EXTRACTOR_ERROR, + EMPTY_ARCHIVE_ERRNO, + "empty archive"); } archive_read_free (a); return; @@ -1877,8 +1877,7 @@ r = libarchive_create_read_object (self->use_raw_format, self, &a); if (r != ARCHIVE_OK) { if (self->error == NULL) { - self->error = - autoar_common_g_error_new_a (a, self->source_basename); + self->error = autoar_common_g_error_new_a (a, NULL); } archive_read_free (a); return; @@ -1999,8 +1998,7 @@ if (r != ARCHIVE_EOF) { if (self->error == NULL) { - self->error = - autoar_common_g_error_new_a (a, self->source_basename); + self->error = autoar_common_g_error_new_a (a, NULL); } archive_read_free (a); return; diff -Nru gnome-autoar-0.4.2/meson.build gnome-autoar-0.4.3/meson.build --- gnome-autoar-0.4.2/meson.build 2022-01-07 09:49:41.691870500 +0000 +++ gnome-autoar-0.4.3/meson.build 2022-02-11 08:37:04.641689500 +0000 @@ -3,7 +3,7 @@ project( 'gnome-autoar', 'c', - version: '0.4.2', + version: '0.4.3', license: 'LGPL2.1+', default_options: 'buildtype=debugoptimized', meson_version: '>= 0.56.0', diff -Nru gnome-autoar-0.4.2/NEWS gnome-autoar-0.4.3/NEWS --- gnome-autoar-0.4.2/NEWS 2022-01-07 09:49:41.688870400 +0000 +++ gnome-autoar-0.4.3/NEWS 2022-02-11 08:37:04.637689600 +0000 @@ -1,3 +1,9 @@ +Major changes in 0.4.3: +* Prevent NULL dereference when extracting to root (Ondrej Holy) +* Do not include basename in error messages (Ondrej Holy) +* Do not request password when encryption is unsupported (Ignacy Kuchciński) +* Propagate libarchive errors when extraction failed (Ignacy Kuchciński) + Major changes in 0.4.2: * Fix extraction to root directory (Ondrej Holy) * Fix extraction of raw format archives (Ondrej Holy)