diff options
| author | RussianSanta12 <127607192+RussianSanta12@users.noreply.github.com> | 2026-12-02 12:38:59 -0500 |
|---|---|---|
| committer | RussianSanta12 <127607192+RussianSanta12@users.noreply.github.com> | 2026-12-02 12:38:59 -0500 |
| commit | 48593f545606e7aca73ee5c841fb9d63d45c5a7f (patch) | |
| tree | 05ab876e1b3df4c284c9184fbb2aafe14b17fec7 /docs/lua-modding.md | |
| parent | 45dc41f95c1cd0dcc29c2c50582e0e9af8a77259 (diff) | |
d3d12 lua: a link to nothing is not written through (D3D12-LUA-WRITE-FILE-DANGLING-LINK)
`manifest::inside` checked the deepest part of the path that exists, found
with `Path::exists`. That follows links, so a link inside the mod's folder
whose target is missing counted as absent: the walk went on to the folder
holding it, which is inside, and `leonida.write_file` then made the link's
target, which may be out of the mod's folder.
- The walk now stops at the deepest entry `symlink_metadata` finds, so a
link counts as there even when its target is missing (also as a folder
part of the path). Canonicalising a link to nothing fails, and that is
now a refusal that names the path: "`out.txt` cannot be resolved inside
the mod's folder (...)".
- Test: a file link to a missing file and a junction (Unix: a folder link)
to a missing folder; neither write goes through and neither target is
made. Without the fix the file write returns true and makes outside.txt.
- docs/lua-modding.md: a link that leads to nothing is refused too.
Not reachable from Lua today (no API makes links): hardening.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/lua-modding.md')
| -rw-r--r-- | docs/lua-modding.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/lua-modding.md b/docs/lua-modding.md index aad61470c..9c1d1fc26 100644 --- a/docs/lua-modding.md +++ b/docs/lua-modding.md | |||
| @@ -164,8 +164,9 @@ require("helper") -- helper.lua (or helper/init.lua; dots are folders) o | |||
| 164 | ``` | 164 | ``` |
| 165 | 165 | ||
| 166 | Files: only the mod's own folder, plain relative paths (no `..`, drive letters, streams or reserved device names; a | 166 | Files: only the mod's own folder, plain relative paths (no `..`, drive letters, streams or reserved device names; a |
| 167 | link that leads out is refused), reads up to 4 MiB, writes up to 1 MiB, never `mod.json` or a program (`.exe`, `.dll`, | 167 | link that leads out of it, or to nothing, is refused), reads up to 4 MiB, writes up to 1 MiB, never `mod.json` or a |
| 168 | `.bat`, ...). There is no `io`. The rule holds for `require` and for the script the manifest names, too. | 168 | program (`.exe`, `.dll`, `.bat`, ...). There is no `io`. The rule holds for `require` and for the script the manifest |
| 169 | names, too. | ||
| 169 | 170 | ||
| 170 | ## The sandbox | 171 | ## The sandbox |
| 171 | 172 | ||