Repository navigation
fix: recognise the unrar 7 "use current password?" prompt - #546
liuwenhuan wants to merge 1 commit into
Conversation
1. When the file data of a RAR archive is encrypted but the headers are not, unrar asks for the password of the first file and then, for each following file, whether to reuse it. unrar 7 prints "<file> - use current password? [Y]es, [N]o, [A]ll" (no space before '?'); unrar 5/6 printed "use current password ? [Y]es, [N]o, [A]ll". 2. isMultiPasswordPrompt() only matched the old text, so with unrar 7 the prompt was never answered: unrar waited on the pty and the progress page stayed at 1 % for ever. 3. Accept both texts; add test cases with the unrar 7 wording. Log: Fix extraction of encrypted RAR archives hanging at 1 % with unrar 7. Influence: 1. With unrar 7.x, extract a RAR5 archive of several files created with "rar a -p<password>" (headers not encrypted), single and multi-volume; enter the password once; extraction completes. 2. The unrar 5/6 prompt is still recognised. fix: 识别 unrar 7 的 "use current password?" 提示 1. RAR 包只加密文件数据、不加密文件头时,unrar 先询问第一个文件的密码, 之后对每个文件询问是否沿用当前密码。unrar 7 的提示是 "<文件> - use current password? [Y]es, [N]o, [A]ll"(问号前没有空格), unrar 5/6 是 "use current password ? [Y]es, [N]o, [A]ll"。 2. isMultiPasswordPrompt() 只匹配旧写法,unrar 7 下这个提示得不到回答, unrar 一直在 pty 上等待,进度页面停在 1%。 3. 两种写法都识别,并补充 unrar 7 写法的测试用例。 Log: 修复 unrar 7 下解压加密 RAR 包卡在 1% 的问题。 Influence: 1. 使用 unrar 7.x 解压 "rar a -p<密码>" 创建的多文件 RAR5 包(文件头不加密), 含分卷;只输入一次密码,解压完成。 2. unrar 5/6 的提示仍能识别。
Reviewer's GuideImplementationRecognize both the unrar 5/6 and unrar 7 spellings of the current-password prompt so extraction can continue.
TestsAdd unit-test coverage for the unrar 7 prompt wording and confirm ordinary extraction output is not mistaken for a password prompt.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
CLA Assistant Lite bot: You can retrigger this bot by commenting recheck in this Pull Request |
When the file data of a RAR archive is encrypted but its headers are not (
rar a -p<password>), unrar asks for the password of the first file and then, for every following file, whether to reuse it. unrar 7 changed that prompt:<file> - use current password ? [Y]es, [N]o, [A]ll<file> - use current password? [Y]es, [N]o, [A]ll(no space before?)CliRarPlugin::isMultiPasswordPrompt()only matched the old text. With unrar 7 the prompt is never answered, unrar waits on the pty for ever, and the progress page stays at 1 % with speed and remaining time "calculating". Only the first file of the archive gets extracted.This change accepts both texts and adds test cases with the unrar 7 wording. The patch applies unchanged to master (6.5.40).
Tested (deepin-compressor 6.5.32.3 Qt6 build, unrar 7.1.8; "Extract here" from the file manager command line):
rar a -ma5 -p... -v5m), headers not encrypted.readme.txtis extracted, then the progress page hangs and unrar keeps waiting.I could not build the unit tests:
tests/UnitTestlooks for the Qt5dtkwidgetand our environment is Qt6 only. The addedEXPECT_EQlines follow the existing cases.RAR 包只加密数据、不加密文件头时,unrar 7 把"是否沿用当前密码"的提示改成了
use current password?(问号前没有空格)。isMultiPasswordPrompt()只认旧写法,这个提示得不到回答,解压一直停在 1%,速度和剩余时间显示"计算中"。本补丁两种写法都识别,并补充了测试用例。Summary by Sourcery
Support unrar 7's updated reuse-password prompt so multi-file encrypted RAR archives extract completely.
Bug Fixes:
Tests: