fix: exclude oversize El Torito [BOOT] entry during iso extraction - #135
Conversation
Reviewer's GuideThe extraction path now performs a pre-extraction 7z technical listing, filters only oversized [BOOT] files beyond FAT32’s 4 GiB − 1-byte limit, and passes targeted -x! exclusions to extraction while falling back safely when scanning is unavailable or fails. Sequence diagram for selective oversized El Torito entry exclusionsequenceDiagram
participant SevenZip
participant ListProcess as 7z listing process
participant ExtractProcess as 7z extraction process
SevenZip->>ListProcess: start(l, -slt, archive)
ListProcess-->>SevenZip: Path / Folder / Size output
SevenZip->>SevenZip: parseOversizeBootPaths(sltOutput)
alt oversized [BOOT] files found
SevenZip->>ExtractProcess: extract archive with -x![BOOT]/path
else scan fails or no oversized files
SevenZip->>ExtractProcess: extract archive without exclusions
end
ExtractProcess-->>SevenZip: extraction result
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ae31a5d to
abe6b86
Compare
|
Warning
详情 {
"export": {
".reuse/dep5": {
"a": [
"Files: src/tools/exportPot src/tools/importPo src/tools/importPo.bat"
],
"b": [
"Files: src/tools/exportPot src/tools/exportPot.bat src/tools/importPo src/tools/importPo.bat"
]
}
}
} |
- Scan `7z l -slt` before extraction and exclude only [BOOT] entries larger than 4GiB-1 (the FAT32 single file limit) - Parse only Path/Folder/Size so it works with both old p7zip and new 7-Zip - Fall back to no exclusion when the scan fails; small [BOOT] entries are kept Log: Fix making bootable USB from large ISO images whose El Torito [BOOT] entry exceeds the FAT32 file size limit Bug: https://pms.uniontech.com/bug-view-377229.html
abe6b86 to
2449e83
Compare
|
Warning
详情 {
"export": {
".reuse/dep5": {
"a": [
"Files: src/tools/exportPot src/tools/importPo src/tools/importPo.bat"
],
"b": [
"Files: src/tools/exportPot src/tools/exportPot.bat src/tools/importPo src/tools/importPo.bat"
]
}
}
} |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 良好 ✅ 通过 潜在问题:
建议: 建议为 waitForStarted 和 waitForFinished 设置合理的超时时间(如30秒),超时后回退到无排除模式,避免应用无限期阻塞 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 将 for (QString line : lines) 改为 for (const QString &line : lines),避免不必要的字符串拷贝 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 1.使用 const QString & 避免拷贝 2.设置合理超时时间替代无限等待 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 无安全漏洞。代码使用QProcess参数列表方式执行命令(非shell),无命令注入风险;路径来自ISO内部结构解析,仅用于7z排除模式,无路径遍历风险;使用QString管理内存,无缓冲区溢出风险;日志仅输出文件路径,无敏感信息泄露。 💡 改进建议代码示例// 优化1: 避免不必要的QString拷贝
const QStringList lines = sltOutput.split(QLatin1Char('\n'));
for (const QString &line : lines) { // 使用 const 引用
if (line.endsWith(QLatin1Char('\r')))
// 注意: line 为 const 时不能调用 chop()
// 可改为: const QString trimmed = line.endsWith('\r') ? line.left(line.size()-1) : line;
...
}
// 优化2: 设置合理超时时间
static const int kScanTimeoutMs = 30000; // 30秒超时
if (!listProcess.waitForStarted(kScanTimeoutMs) || !listProcess.waitForFinished(kScanTimeoutMs)) {
qWarning() << "scan iso failed, skip [BOOT] exclusion:" << listProcess.errorString();
return result;
}本报告由 AI 代码审查工具自动生成 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000, max-lvs 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 |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
7z l -sltbefore extraction and exclude only [BOOT] entries larger than 4GiB-1 (the FAT32 single file limit)Log: Fix making bootable USB from large ISO images whose El Torito [BOOT] entry exceeds the FAT32 file size limit
Bug: https://pms.uniontech.com/bug-view-377229.html
Please do not send pull requests to the linuxdeepin/*
see https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers
Thanks!
Summary by Sourcery
Exclude oversized El Torito boot entries during ISO extraction while retaining compatible fallback behavior.
Bug Fixes:
Enhancements:
Chores: