Log IPC uses the VM name from the renderer as a file name

未关闭 适合新手
#79 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
86/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
electron, typescript
领域
desktop, security

调研方向

阅读 src/main/ipc.ts,并将 openLog 和 readLog 与通过 byName 验证名称的处理器进行比较。按照 issue 的说明,在两个处理器中都先调用 byName(name),并根据 cfg.name 构建各自的日志路径。当两个处理器都会拒绝无法标识 VM 的名称,并使用经过验证的名称构建路径时,即为完成。

由索引模型根据 Issue 内容生成。

描述

backend bug

openLog and readLog in src/main/ipc.ts build the path as join(paths.logs, `${name}.log`) straight from what the renderer sends. Every other handler goes through byName, which only accepts a name that is a real VM.

A name like ..\..\something reads or opens a .log file outside the logs folder. The renderer is our own code, so this isn't reachable from a guest, but the IPC layer is supposed to check its arguments and these two don't.

Fix: byName(name) first in both, and use cfg.name for the path.

主要语言
TypeScript
星标
3
派生
0
平均合并
2 分钟
30 天内合并 PR
35

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

A21-devs/Virtual-Machine-Manager 的其他 Issue

查看 A21-devs/Virtual-Machine-Manager 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。