https://bugs.kde.org/show_bug.cgi?id=486289
Bug ID: 486289
Summary: 7z encryption detection logic is inefficient and silly
Classification: Applications
Product: krusader
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: krarc
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
I'll keep the performance issue mostly to Bug #457906 , but the explanation is
a useful setup here too.
`getType` in app/Archive/krarchandler.h has a sneaky `bool check7zEncrypted =
true` which appears to be left at the default value everywhere. This leads to
`kio_krarcProtocol::checkIf7zIsEncrypted` and therefore
`kio_krarcProtocol::check7zOutputForPassword` getting executed not even just
once, but apparently several times every time the archive or a directory in it
is entered. As the external 7z tool is executed by `checkIf7zIsEncrypted` to
get a full file list, the performance issue is quite obvious.
The explained check is what's leading to the "silly" part which can be
considered broken in some cases. I found this whole issue because Krusader was
persistently asking for a password, multiple times every time an archive or a
directory in it was opened, so between the performance issues and the dialog
popups, it was a chore to do anything.
Figured out the hard way that my non-encrypted archive was triggering the
`line.contains("password") && line.contains("enter")` check in
`check7zOutputForPassword`, making Krusader believe that it's encrypted.
Problem is that a file in the archive could be called `enter_password.html`,
and Krusader would be fooled as "enter" and "password" would be matched on the
same line in the output of 7z, leading to the password dialog torture.
7z handling in general isn't exactly great anywhere, but surprised to see that
Krusader makes the matter significantly worse. Ark doesn't have this oddity.
--
You are receiving this mail because:
You are watching all bug changes.