After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772246 - AutoarExtractor: check encrypted entry after header is read
AutoarExtractor: check encrypted entry after header is read
Status: RESOLVED FIXED
Product: gnome-autoar
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Autoar maintainer(s)
GNOME Autoar maintainer(s)
: 771801 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-09-30 10:54 UTC by Razvan Chitu
Modified: 2017-01-08 18:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
AutoarExtractor: check encrypted entry after header is read (2.44 KB, patch)
2016-09-30 10:54 UTC, Razvan Chitu
reviewed Details | Review

Description Razvan Chitu 2016-09-30 10:54:38 UTC
See patch.
Comment 1 Razvan Chitu 2016-09-30 10:54:42 UTC
Created attachment 336629 [details] [review]
AutoarExtractor: check encrypted entry after header is read

If an archive has an encrypted header, libarchive will return a fatal error code
when attempting to read it. This is a problem because it will skip the
verification for encrypted entries. In order to fix this, check if entries are
encrypted outside of the header reading loop.
Comment 2 Carlos Soriano 2016-10-12 10:51:30 UTC
*** Bug 771801 has been marked as a duplicate of this bug. ***
Comment 3 Carlos Soriano 2016-10-12 11:09:52 UTC
Review of attachment 336629 [details] [review]:

I cannot see the difference on this patch vs the previous code, you break and return in case it is encrypted. How does it differs? I believe I'm missing something.
Comment 4 Razvan Chitu 2016-10-12 11:13:34 UTC
(In reply to Carlos Soriano from comment #3)
> Review of attachment 336629 [details] [review] [review]:
> 
> I cannot see the difference on this patch vs the previous code, you break
> and return in case it is encrypted. How does it differs? I believe I'm
> missing something.

If the entire header is encrypted, the 'while' condition will be false right from the start. That's why I have to check the entry outside, to also cover this case.
Comment 5 Ting-Wei Lan 2016-11-27 17:12:53 UTC
Review of attachment 336629 [details] [review]:

This patch looks correct. You can commit it after deleting the indent-fixing hunk.

::: gnome-autoar/autoar-extractor.c
@@ +1622,3 @@
+                                 "\'%s\': %s",
+                                 self->source_basename,
+                                 "empty archive");

If you want to fix the indent problem, please do it in a separate commit. It will be better if you can include the above 'not an archive' g_error_new call in that commit.
Comment 6 Ting-Wei Lan 2017-01-08 18:10:53 UTC
I modified your patch and committed it as a7ff65c.