Files
skillshare/internal/plugin
Willie ca11f63a09 fix(plugin): trust symlinked ancestors of the Agent config root (#368)
* fix(plugin): trust symlinked ancestors of the Agent config root (#365)

noSymlink walked every ancestor up to / and refused the write if any was a
link, so macOS /var, a home on a linked volume, a dotfiles-linked ~/.pi, or a
PI_CODING_AGENT_DIR / CLAUDE_CONFIG_DIR / CODEX_HOME behind a link failed with
"refusing to modify symlinked native path".

noSymlink now takes the root the user chose (the Agent folder, the project,
or Skillshare's state dir) and checks only the path and the folders between
it and that root, refusing paths outside it. The root is compared lexically
because every checked path is built by joining onto it, so no EvalSymlinks
call is needed. A linked config file or a linked folder inside the root is
still refused, and Windows junctions are still detected via IsLinkMode.

* fix(plugin): bound the noSymlink ancestor walk by its relative depth

The walk stopped when p equalled root, but on Windows Dir spells a UNC
share root with a trailing separator (\\server\share\) while Clean keeps
the root without it, so the loop never ended for a PI_CODING_AGENT_DIR,
project root or StateDir on a share root. Walk up exactly as many levels
as the relative path has instead.
2026-10-04 02:50:00 +08:00
..