Skip to content

[Bug] Electron Desktop:OPS 替换原版 read 后,无法读取 ASAR 包内文件 #836

Closed

Description

@lsn7577

dsh-ops version and how it was installed

0.5.2

DSH version and profile

DSH(0.2.2-rc.1)

OS and architecture

Windows x64

Minimal reproduction

在 Electron Desktop 中启用 dsh-ops,并开启官方文件工具替换。

选择一个存在的 ASAR 内 UTF-8 文本文件,例如:

代码块


D:/Kostal-Chat/resources/app.asar/dsh/package.json
调用原版读取工具:

json


{
  "file_path": "D:/Kostal-Chat/resources/app.asar/dsh/package.json",
  "limit": 4
}
按错误提示,改用 ops_inspect_local_file:

json


{
  "path": "D:/Kostal-Chat/resources/app.asar/dsh/package.json",
  "limit": 4
}

Expected behaviour

开启 OPS 后,仍应保留对 Electron ASAR 内文件的合法只读访问:

普通文件继续使用 OPS。
ASAR 内文件使用原版 Host read,不受 OPS 替换规则拦截。
保留 Host 原有的权限检查、参数验证及读取限制。
不因该例外开放 ASAR 写入,或声称原生搜索工具支持 ASAR 遍历。
模型侧提示也应明确说明:

For files inside Electron ASAR archives, use the host read tool with file_path. Do not substitute OPS native readers or search tools.

Actual reading

原版 read 被拒绝:

代码块


Error: dsh-ops cordis mode replaced the official tool read with
ops_inspect_local_file; call ops_inspect_local_file, or turn off
that replacement in the dsh-ops row settings.
OPS 读取同类 ASAR 内路径时,在预检查阶段拒绝:

代码块


rejected: PATH_RESTRICTED
[Notice: effectState=none; retry=never; phase=preflight.]

Next: Inspect the real path and linked/special components;
do not bypass no-follow protection.

inspect_local_file: Links, reparse points and special objects
are not traversed; inspect the target path for the offending entry
ops_grep 搜索 ASAR 内目录也会返回同类 PATH_RESTRICTED,尚未进入实际搜索阶段。

作为对照,ASAR 外的普通文件可以通过 ops_inspect_local_file 正常读取。

Reproduced in isolation?

Reproduced in an isolated profile / temporary DSH_HOME

Anything else (optional)

No response

Activity

  1. Thatgfsj commented on Nov 20, 2026

    @Thatgfsj
    Collaborator

    ASAR 相关交付随 #1006(现经 #1033 合入 main)落地:worker 遇到 Electron .asar 的成员路径时返回结构化 ARCHIVE_MEMBER_UNSUPPORTED 并点名归档文件(只有 Electron 进程内被补丁的文件系统会把它当目录),不再是误导性的「不存在/遍历越界」,并给出「解包副本」的可执行替代。读取 ASAR 内文件本身不在本仓库能力范围(私有虚拟文件系统),故按「可操作诊断 + 替代方案已交付」关闭。证据:native/crates/ops-files/src/file_path.rs、test/file-asar-path.test.mjs、docs/file-contracts.md。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions