Repository navigation
revert: 撤销 v2.1.0 原生插件 deinit 跳过与压缩包解压限额(保留市场 ID 校验) - #364
Merged
OrientCOMPASS merged 2 commits intoOct 8, 2026
Merged
Conversation
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.
撤销 v2.1.0 中的两处改动:
1e5e1b1fix: skip native plugin deinit after a failed init(原生插件初始化失败后跳过 deinit)164785efix: bound plugin archive extraction and validate market ids(限制插件压缩包解压大小与条目数,校验市场插件 ID)install_from_url中的市场插件 ID 校验原样保留共 2 个撤销提交,仅涉及
micyou-plugin/src/native.rs与micyou-core/src/plugins/install.rs两个文件。理由
1. init 失败后跳过 deinit 会造成“资源拿了不放回”的泄漏
插件在
micyou_plugin_init失败返回时,可能已经获取了资源(分配内存、打开句柄、创建工作线程等)。宿主此时跳过micyou_plugin_deinit、直接卸载动态库,插件就在代码消失前失去了归还这些资源的唯一机会,泄漏发生在宿主进程内。docs/plugins/api-reference.md对deinit的约定也是“清理(宿主卸载库前调用一次)”,并无 init 失败的例外。因此应保持修改前的实现:卸载前无条件调用 deinit。2. 解压限额误伤真实插件;zip bomb 不在本项目防御范围内
164785e中的市场插件 ID 校验(防止市场返回的 ID 污染临时文件路径)有实际价值,本 PR 予以保留,不在撤销之列。影响范围与验证
native.rs逐字节恢复到1e5e1b1之前的状态;install.rs恢复到164785e之前的状态、仅额外保留 ID 校验块——涉及的代码均为历史上存在于 master 并经过 CI 的版本。