Bug 329941 - Ark is not handling passworded 7z files
Summary: Ark is not handling passworded 7z files
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: 2.19
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Raphael Kubo da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 01:14 UTC by Konomi
Modified: 2014-03-18 22:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.12.4


Attachments
7z passworded file for testing (198 bytes, application/x-7z-compressed)
2014-01-14 01:15 UTC, Konomi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konomi 2014-01-14 01:14:34 UTC
Creating a passworded 7z file and trying to opening it in ark results in no file list and no prompt for a password. Attaching test file password is test.

Versions:
Debian jessie
Ark v2.19
7z 9.20

Steps:
$ touch test.txt

$ nano test.txt

$ 7z a -mx=9 -mhe -p test.7z test.txt 

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_AU.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)
Scanning

Creating archive test.7z


Enter password (will not be echoed) :
Verify password (will not be echoed) :
Compressing  test.txt      

Everything is Ok

$ ark test.7z 
ark(20373)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
ark(20373)/kdeui (kdelibs) KXMLGUIClient::~KXMLGUIClient: 0x173b4c8 deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes.

$ 7z t test.7z 

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_AU.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)

Processing archive: test.7z

Enter password (will not be echoed) :

Testing     test.txt

Everything is Ok

Size:       5
Compressed: 198


Reproducible: Always
Comment 1 Konomi 2014-01-14 01:15:27 UTC
Created attachment 84634 [details]
7z passworded file for testing
Comment 2 Christoph Feck 2014-01-14 02:09:04 UTC
Cannot reproduce, it works here with ark from KDE 4.12.1 and 7z installed. With the password "test", I could list contents "test.txt", and clicking the file shows text "test".

7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)

The only difference I see is that you are using the 64 bit version of 7z. Could you please add the output of "7z l -slt test.7z" from your system?
Comment 3 Konomi 2014-01-19 08:13:38 UTC
(In reply to comment #2)
> Cannot reproduce, it works here with ark from KDE 4.12.1 and 7z installed.
> With the password "test", I could list contents "test.txt", and clicking the
> file shows text "test".
> 
> 7-Zip 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
> p7zip Version 9.20 (locale=de_DE.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)
> 
> The only difference I see is that you are using the 64 bit version of 7z.
> Could you please add the output of "7z l -slt test.7z" from your system?

Providing output:

$ 7z l -slt test.7z

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=en_AU.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)

Enter password (will not be echoed) :

Listing archive: test.7z

--
Path = test.7z
Type = 7z
Method = LZMA 7zAES
Solid = -
Blocks = 1
Physical Size = 198
Headers Size = 182

----------
Path = test.txt
Size = 5
Packed Size = 16
Modified = 2014-01-14 12:07:34
Attributes = ....A
CRC = 3BB935C6
Encrypted = +
Method = LZMA:16 7zAES:19
Block = 0
Comment 4 Konomi 2014-03-07 05:46:40 UTC
I have solved this issue. Debian has two versions of p7zip, p7zip and p7zip-full. With only p7zip-full installed I get a password prompt, but if I install p7zip even with p7zip-full installed I get no password. I wonder on which end the bug is in this case? Could it be p7zip's packaging in Debian or something to do with ark?
Comment 5 Raphael Kubo da Costa 2014-03-18 22:38:41 UTC
(In reply to comment #4)
> I have solved this issue. Debian has two versions of p7zip, p7zip and
> p7zip-full. With only p7zip-full installed I get a password prompt, but if I
> install p7zip even with p7zip-full installed I get no password. I wonder on
> which end the bug is in this case? Could it be p7zip's packaging in Debian
> or something to do with ark?

This happens because p7zip on Debian installs 7zr and p7zip-full installs 7za and 7z. We look for and try to use the binaries in this order, but 7zr doesn't seem to be able to handle encrypted archives.
Comment 6 Raphael Kubo da Costa 2014-03-18 22:49:17 UTC
Git commit 3170fd1017b19bce532a8c9e679dd7297b1c70b1 by Raphael Kubo da Costa.
Committed on 18/03/2014 at 22:41.
Pushed by rkcosta into branch 'KDE/4.12'.

cli7zip: Change the precedence order of the 7z binaries we look for.

Instead of going from least capable (7zr) to most capable (7z), do the
opposite. Looking for 7zr first means that even though a 7z binary capable
of handling a certain archive type might be present on the system it will
not be used. This is particularly troublesome because 7zr does not support
archives with password.

This should not cause any problems for distros that ship only some 7zip
binaries since we still look for all 3 of them (7z, 7za and 7zr).
FIXED-IN:	4.12.4

M  +1    -1    plugins/cli7zplugin/cliplugin.cpp

http://commits.kde.org/ark/3170fd1017b19bce532a8c9e679dd7297b1c70b1