尽快推进:收紧OPFS程序读取源码锚点

This commit is contained in:
cnc
2026-06-05 08:48:46 +08:00
parent abaebe7940
commit 218ac523b8
2 changed files with 23 additions and 1 deletions

View File

@@ -11,6 +11,9 @@ persistence. It is a policy and bridge map only; it must not add independent fil
`RS274NGC_PARAMETER_FILE_BACKUP_SUFFIX` as `.bak`.
- `src/emc/rs274ngc/rs274ngc_pre.cc` implements
`Interp::restore_parameters()` for parameter-file reads.
- `src/emc/rs274ngc/rs274ngc_pre.cc` implements `Interp::open()` by opening
the NC program file with `fopen(filename, "r")`, then `Interp::_read()`
feeds `_setup.file_pointer` into `read_text()`.
- `src/emc/rs274ngc/rs274ngc_pre.cc` implements
`Interp::save_parameters()` for `filename + ".new"`, backup, and replacement
writes.
@@ -22,7 +25,7 @@ persistence. It is a policy and bridge map only; it must not add independent fil
| Entry | Boundary |
| --- | --- |
| `web/src/wasm-core.js` | Keeps LinuxCNC parameter restore/save bridge files under the OPFS workspace and cleans WASM scratch files. |
| `web/src/wasm-core.js` | Keeps LinuxCNC program reads and parameter restore/save bridge files under the OPFS workspace and cleans WASM scratch files. |
| `web/src/wasm-core.d.ts` | Exposes only the OPFS-backed workspace, directory, parameter-file, and mount/workspace option types used by the bridge. |
| `web/src/app.js` | Persists browser programs at `programs/current.ngc` and LinuxCNC parameters at `parameters/rs274ngc.var`. |
| `web/test-browser-wasm-smoke-opfs-basic-sections.js` | Verifies OPFS program file reads through LinuxCNC `read_text()` and rejects unsafe paths. |