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 707568 - file-roller incompatible with rar-5 beta, fails to display contents of rar archives
file-roller incompatible with rar-5 beta, fails to display contents of rar ar...
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
file-roller-maint
: 707817 708774 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-09-05 14:06 UTC by Alexandre Rostovtsev
Modified: 2013-09-25 18:13 UTC
See Also:
GNOME target: ---
GNOME version: 3.7/3.8


Attachments
test rar file (contains lorem.txt) (374 bytes, application/x-rar)
2013-09-05 14:06 UTC, Alexandre Rostovtsev
  Details
screenshot : using file-roller-3.8.4 and rar-5.00 beta 8 to open test.rar (21.78 KB, image/png)
2013-09-05 14:11 UTC, Alexandre Rostovtsev
  Details
screenshot : using file-roller-3.8.4 and rar-4.20 to open test.rar (30.86 KB, image/png)
2013-09-05 14:11 UTC, Alexandre Rostovtsev
  Details
proposed patch, adds support for rar-5 and unrar-5 (6.67 KB, patch)
2013-09-09 00:35 UTC, Alexandre Rostovtsev
none Details | Review
fix unrar-5 detection (771 bytes, patch)
2013-09-09 13:51 UTC, Alexandre Rostovtsev
none Details | Review

Description Alexandre Rostovtsev 2013-09-05 14:06:49 UTC
Created attachment 254183 [details]
test rar file (contains lorem.txt)

When using rar-5.00 beta 8, file-roller fails to show the contents of any .rar file I've tried. No error messages are displayed.

After downgrading to rar-4.20, file-roller is able to show the archive contents successfully, and to extract them.
Comment 1 Alexandre Rostovtsev 2013-09-05 14:11:02 UTC
Created attachment 254184 [details]
screenshot : using file-roller-3.8.4 and rar-5.00 beta 8 to open test.rar
Comment 2 Alexandre Rostovtsev 2013-09-05 14:11:43 UTC
Created attachment 254185 [details]
screenshot : using file-roller-3.8.4 and rar-4.20 to open test.rar
Comment 3 Alexandre Rostovtsev 2013-09-09 00:35:47 UTC
Created attachment 254438 [details] [review]
proposed patch, adds support for rar-5 and unrar-5

In rar-5, the "rar v" archive listing format changed. Instead of

filename
    size packed ratio date time attr checksum method version

you now have

attr size packed ratio date time checksum filename_sometimes_with_trailing_spaces


With this patch, file-roller should be able to handle both listing formats. I've tested it on various rars (single and multivolume) with rar-5 and 4.2, and it seems to work.
Comment 4 Alexandre Rostovtsev 2013-09-09 00:45:55 UTC
Also: detecting rar-5 by a "Details:" line in the header may raise some eyebrows, but it's the solution that KDE folks have settled on for Ark (see https://git.reviewboard.kde.org/r/111625/diff/#index_header), and it's probably no worse than attempting to parse rar and unrar version strings.
Comment 5 Paolo Bacchilega 2013-09-09 08:51:04 UTC
Hi,

I have applied the patch to master, with some minor changes, can you please test the current master version and see if it works for you?
Comment 6 Alexandre Rostovtsev 2013-09-09 13:51:24 UTC
Created attachment 254483 [details] [review]
fix unrar-5 detection

(In reply to comment #5)
Tested by backporting your changes to 3.8 (I don't have a working gnome-3.9 chroot at the moment, and file-roller master requires gtk+-3.9).

The only issue I found is that your way of detecting rar version won't work for unrar-5. I've attached a patch to fix that problem.
Comment 7 Paolo Bacchilega 2013-09-09 18:31:10 UTC
Thanks for finding this problem, it is fixed in master now, but I had to change your patch because when using unrar you have to change the string passed to sscanf as well.
Comment 8 Alexandre Rostovtsev 2013-09-09 18:38:50 UTC
(In reply to comment #7)
> Thanks for finding this problem, it is fixed in master now, but I had to change
> your patch because when using unrar you have to change the string passed to
> sscanf as well.

You didn't need to change it: "RAR %d." is a substring of "UNRAR %d.", so the same sscanf() works for both :)

(If you were using Microsofts's sscanf_s(), it would be a different story.)
Comment 9 Alexandre Rostovtsev 2013-09-09 18:52:01 UTC
(In reply to comment #8)

I apologize, you are quite right, I had forgotten how sscanf() works :/ I don't know why I had thought that my unrar-5 detection patch worked - probably I had made a mistake in my testing...
Comment 10 Paolo Bacchilega 2013-09-10 05:33:44 UTC
(In reply to comment #9)
> (In reply to comment #8)
> 
> I apologize, you are quite right, I had forgotten how sscanf() works :/ I don't
> know why I had thought that my unrar-5 detection patch worked - probably I had
> made a mistake in my testing...

I thought the same thing, but some testing proved me wrong :)
Comment 11 Paolo Bacchilega 2013-09-10 05:34:33 UTC
*** Bug 707817 has been marked as a duplicate of this bug. ***
Comment 12 Paolo Bacchilega 2013-09-25 18:13:45 UTC
*** Bug 708774 has been marked as a duplicate of this bug. ***