mirror of
https://github.com/affaan-m/ECC.git
synced 2026-11-17 05:22:17 +00:00
fix(gateguard): match every .claude/settings*.json variant
The pattern only accepted settings.json and settings.<suffix>.json, so a plain settings-dev.json stayed editable on the subagent paths that only gate sensitive or hard-linked targets. Use settings[^/]*.json and cover the dash-suffixed variants plus a non-settings control.
This commit is contained in:
1 parent
01c2426b2c
commit
fc7ec24d56
2 files changed
+19
-1
No files matched your search
@@ -300,7 +300,7 @@ function isSensitiveTarget(classPath) {
|
||||
// `.claude/settings*.json` holds the switches for GateGuard and the other
|
||||
// hooks, so it must count as restricted on every edit path — including the
|
||||
// subagent paths that only deny sensitive or hard-linked targets (#3862).
|
||||
const CLAUDE_SETTINGS_PATH = /(^|\/)\.claude\/settings(?:\.([^/]+))?\.json$/;
|
||||
const CLAUDE_SETTINGS_PATH = /(^|\/)\.claude\/settings[^/]*\.json$/;
|
||||
|
||||
function isClaudeSettingsPath(classPath) {
|
||||
return CLAUDE_SETTINGS_PATH.test(String(classPath || '').replace(/\\/g, '/').toLowerCase());
|
||||
|
||||
Reference in new issue
Block a user