gstack/browse
asizux2 48720243b1 fix(windows): grant icacls by SID, not unqualified username
An unqualified username is ambiguous. On a machine whose hostname equals
the username, it does not resolve to the user account; icacls silently
writes an ACE for the machine SID instead. Combined with /inheritance:r,
the directory is left with a single ACE that matches nobody, so the
process that just created it can no longer enumerate or write to it.

In practice this means browse can never start on an affected machine: it
bricks .gstack/ on first run, then reports "Another instance is starting
the server" because acquireServerLock() returns null on the resulting
EACCES. The real cause is invisible, since icacls reports success and
stdio is ignored.

Resolve the current user's SID and pass icacls the literal *<SID> form,
which is immune to name-resolution ambiguity. Fall back to the
domain-qualified name if the lookup fails.

The SID lookup pins %SystemRoot%\System32\whoami.exe rather than a bare
`whoami`, which under a bash-flavoured PATH resolves to the MSYS build
and rejects /user. Without the pin the primary path would silently fail
on Git Bash, one of the most common Windows setups for this tool.

Tests assert the directory stays usable by the calling process after
hardening. The existing Windows cases only asserted "does not throw",
which this bug sails straight past. On the pre-fix code path 8 of 15
tests fail, several of them pre-existing.

Refs #2478

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 12:37:23 +03:00
..
bin feat: multi-agent support — gstack works on Codex, Gemini CLI, and Cursor (v0.9.0) (#226) 2026-03-19 18:20:50 -07:00
scripts fix: ngrok Windows build + close CI error-swallowing gap (v0.18.0.1) (#1024) 2026-04-16 13:49:04 -07:00
src fix(windows): grant icacls by SID, not unqualified username 2026-08-08 12:37:23 +03:00
test fix(windows): grant icacls by SID, not unqualified username 2026-08-08 12:37:23 +03:00
PLAN-snapshot-dropdown-interactive.md fix: snapshot -i auto-detects dropdown/popover interactive elements (#845) 2026-04-05 22:57:45 -07:00
SKILL.md v1.58.5.0 feat: first-run activation scaffold + gstack router front door (#2078) 2026-06-25 09:42:45 -07:00
SKILL.md.tmpl v1.57.8.0 feat: browse js/eval --out render-to-file (canonical Chromium for offline rendering) (#1929) 2026-06-09 21:02:30 -07:00