Bug 115152 - Ark asking for password, says it isn't correct, but it is!
Summary: Ark asking for password, says it isn't correct, but it is!
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: 2.6
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Harald Hvaal
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-26 22:35 UTC by David Watzke
Modified: 2006-03-11 13:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testcase: Password-protected RAR file (13.86 KB, application/x-rar-compressed)
2005-11-15 09:25 UTC, Simon Raffeiner
Details
Testcase: Password-protected ZIP file (13.92 KB, application/x-zip)
2005-11-15 09:25 UTC, Simon Raffeiner
Details
Patch for the RAR extraction bug (346 bytes, patch)
2005-11-15 14:04 UTC, Simon Raffeiner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Watzke 2005-10-26 22:35:49 UTC
Version:           2.6.0 (using KDE KDE 3.4.92)
Installed from:    Gentoo Packages
Compiler:          gcc-3.4.4-r1 x86_64-pc-linux-gnu-3.4.4
OS:                Linux

Yeah, I sucessfully 'unrar x' this file, with a password (russianmp3.qps.ru), but Ark says it isn't correct and asking for((;;)) ... And next problem is: Ark in .rar context menu (konqueror) shows only Compress, but no Extract (?) ... when I rename suffix for example to .r00 it's good. Heh. Sorry for any inexactness, 'cause I've got localized KDE. I hope you catch what I mean.. :/
Comment 1 Haris Kouzinopoulos 2005-10-27 00:34:10 UTC
You are reporting 2 seperate bugs, you should fill 2 bug reports
Comment 2 David Watzke 2005-10-27 00:44:50 UTC
Yes, but it's boring filling 100x the same... :( Sorry.
Comment 3 Henrique Pinto 2005-11-14 21:28:13 UTC
Hi!

Could you please provide me password-protected RAR archives so that I can try to reproduce and fix this bug?
Comment 4 David Watzke 2005-11-14 22:15:37 UTC
I haven't any password-protected RAR at the moment. :-( You can create it with app-arch/rar. :-) Problem was with all this archives, so I think with rar (tool) too. Try password with dots. :-)
Comment 5 Simon Raffeiner 2005-11-15 09:23:26 UTC
I may be wrong, but rar.cpp doesn't seem to contain any code for handling passwords. zip.cpp contains a line like this

if ( !m_password.isEmpty() )
    *kp << "-P" << m_password;

but I could not find a corresponding line of code in rar.h. It should be possible to just copy it over from zip.cpp and replace the -P for -p, I didn't try it but this might be the cause.

BTW: When creating a password-protected ZIP file, zip wants a space between -P and the password, when decompressing it doesn't care for the space. rar and unrar need the password directly after -p. I created two password-protected files and added them as attachments.
Comment 6 Simon Raffeiner 2005-11-15 09:25:10 UTC
Created attachment 13463 [details]
Testcase: Password-protected RAR file

Password: test
Comment 7 Simon Raffeiner 2005-11-15 09:25:55 UTC
Created attachment 13464 [details]
Testcase: Password-protected ZIP file

Password: test
Comment 8 Simon Raffeiner 2005-11-15 14:04:05 UTC
Created attachment 13465 [details]
Patch for the RAR extraction bug

Patch against SVN kdeutils Branch 3.5, the solution for the RAR problem was
very simple. I still have problems extracting password protected ZIP files (ark
starts using 100% CPU after the "Destination Folder" Dialog) but it seems to
work when run through the KDevelop Debugger. Strange.
Comment 9 David Watzke 2005-11-15 17:03:35 UTC
Yes, maybe simple, but not working for me. I used same way as for patch xorg-server-0.99.3-r1 and kopete- - ebuild ... unpack, patch it, ebuild ... compile, install and qmerge... and RAR want's password, okay, type > test < and wanna password again and again...
Comment 10 Simon Raffeiner 2005-11-16 11:01:37 UTC
Strange, I have it running on two different Installations of Ubuntu Breezy. Did you check out kdeutils from KDE SVN, apply the patch to ark, compile it and then make install?
Comment 11 David Watzke 2005-11-16 14:03:31 UTC
No, maybe this is the problem. I don't want full kdeutils - I'm using single programs - kde-base/ark.
Comment 12 Haris Kouzinopoulos 2006-03-11 13:42:52 UTC
SVN commit 517553 by charis:

Patch by Simon Raffeiner, fixes the extraction on password protected RARs
BUG: 115152
CCMAIL: sturmflut@lieberbiber.de



 M  +1 -1      arch.cpp  
 M  +1 -1      rar.cpp  


--- branches/KDE/3.5/kdeutils/ark/arch.cpp #517552:517553
@@ -166,7 +166,7 @@
             unarchFileInternal(); // try to extract the file again with a password
             return;
         }
-	 m_password = "";
+        m_password = "";
         emit sigExtract( false );
         delete _kp;
         _kp = m_currentProcess = 0;
--- branches/KDE/3.5/kdeutils/ark/rar.cpp #517552:517553
@@ -225,7 +225,7 @@
   *kp << m_unarchiver_program << "x";
 
   if ( !m_password.isEmpty() )
-    *kp << "-p=" + m_password;
+    *kp << "-p" + m_password;
 
   if ( !ArkSettings::extractOverwrite() )
   {