Archives: Fix a 7z execution, allow password asking, clarify the name of a function
ClosedPublic

Authored by asensi on Mar 29 2020, 11:32 PM.

Details

Summary

In Krusader, nowadays it turns out that in kio_krarcProtocol::checkIf7zIsEncrypted(): 7z is executed with a " t -y " argument, instead of being executed with two arguments, therefore the execution fails. To avoid that, a simple change can be made.

In more detail: After applying the proposed changes, a 7z execution is left as other places are in the Krusader source code like in KRarcHandler::checkIf7zIsEncrypted(bool &encrypted, QString fileName):

proc << KrServices::fullPathName("7z") << "-y" << "t";

or KRarcHandler::arcFileCount(const QString& archive, const QString& type, const QString& password, KRarcObserver *observer):

else if (type == "7z")  lister << KrServices::fullPathName("7z") << "-y" << "l";

After the change is applied, at least an improvement is seen: when the user tries to enter a compressed 7z file, its password is asked.

Besides:

  • A checkOutputForPassword() function that was used (and useful) only for 7z files was renamed as check7zOutputForPassword().

FIXED: [ 419396 ] When trying to open a 7z encrypted archive, Krusader does not ask for a password
BUG: 419396

Test Plan

Diff Detail

Repository
R167 Krusader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
asensi requested review of this revision.Mar 29 2020, 11:32 PM
asensi created this revision.
yurchor added a subscriber: yurchor.Apr 7 2020, 1:33 PM

Works for me. +1

This revision was not accepted when it landed; it landed in state Needs Review.Apr 15 2020, 10:46 PM
This revision was automatically updated to reflect the committed changes.