fix(#266113): RAR5 wrong password shows incorrect prompt text - #470
Open
LiHua000 wants to merge 1 commit into
Open
fix(#266113): RAR5 wrong password shows incorrect prompt text#470LiHua000 wants to merge 1 commit into
LiHua000 wants to merge 1 commit into
Conversation
…dialog RAR5 wrong password走 else 分支 emit error + return true 不终止进程, unrar 再次输出密码提示导致 ET_WrongPassword 被覆盖为 ET_NeedPassword → ET_NoError,错误上下文丢失。首问与重试复用同一 PasswordNeededQuery、 同一写死文案「此文件已加密」,瞬时错误提示被对话框掩盖。 修复方向①(最小侵入):新增 m_bWrongPasswordRetry 标记,在 RAR5 else 分支 设为 true,handlePassword 重弹密码框时传入该标记,PasswordNeededQuery 据 此显示「密码错误,请重新输入解压密码」而非「此文件已加密」。标记在每次 handlePassword 后重置。 不破坏 ET_MissingVolume 豁免,不影响 RAR4/ZIP/7z 现有逻辑。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideImplements a minimal-intrusion fix so that RAR5 wrong-password retries display a dedicated "Wrong password" prompt instead of the generic "Encrypted file" prompt, by threading a retry flag from the RAR plugin to the password query dialog. Sequence diagram for the RAR5 wrong-password retry promptsequenceDiagram
participant RAR5 as CliRarPlugin
participant CLI as CliInterface
participant Query as PasswordNeededQuery
actor User
RAR5->>RAR5: handleLine(line, workStatus)
RAR5->>CLI: m_bWrongPasswordRetry = true
CLI->>Query: PasswordNeededQuery(name, m_bWrongPasswordRetry)
CLI->>CLI: m_bWrongPasswordRetry = false
CLI->>Query: waitForResponse()
Query->>User: Display Wrong password, please re-enter the password
User-->>Query: Enter password
Query-->>CLI: Password response
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug #266113
归档管理器压缩包解密输入错误密码提示此文件已加密(仅 RAR5)
根因
RAR5 错误密码走
clirarplugin.cppelse 分支emit error(tr("Wrong password"),...) + return true,不终止进程。unrar 再次输出密码提示,导致ET_WrongPassword被覆盖为ET_NeedPassword→ET_NoError(cliinterface.cpp:1050),错误上下文丢失。首问与重试复用同一PasswordNeededQuery、同一写死文案「此文件已加密」(queries.cpp:379),瞬时错误提示被对话框掩盖。对比 RAR4/7z/ZIP 均通过
return false终止并持久显示「密码错误」,唯独 RAR5 异常。修复方案(方向① — 最小侵入)
新增
m_bWrongPasswordRetry标记(CliInterface成员),在 RAR5 else 分支设为true,handlePassword()重弹密码框时传入PasswordNeededQuery,据此显示「密码错误,请重新输入解压密码」而非「此文件已加密」。标记在每次handlePassword()后重置为false。变更文件
3rdparty/interface/queries.h— 构造函数增加bool bWrongPassword = false参数(默认值,向后兼容)3rdparty/interface/queries.cpp— 构造函数存储标记,execute()据此区分提示文案3rdparty/interface/archiveinterface/cliinterface.h— 新增m_bWrongPasswordRetry成员3rdparty/interface/archiveinterface/cliinterface.cpp—handlePassword()传入标记并重置3rdparty/clirarplugin/clirarplugin.cpp— RAR5 else 分支设m_bWrongPasswordRetry = true兼容性
PasswordNeededQuery新参数默认false,现有调用与单元测试(ut_queries.cpp)无需改动。ET_MissingVolume豁免逻辑。6a7a7c9665b098275c0d75d1224621afb76d6908(release/eagle)Summary by Sourcery
Correct the RAR5 wrong-password flow so retries display an explicit incorrect-password message.
Bug Fixes:
Enhancements: