fix: preserve CHFS absolute section rule semantics

This commit is contained in:
OpenClaw Agent
2026-09-21 22:47:51 +08:00
parent cfe7295a96
commit ce5b9493aa
+4 -1
View File
@@ -110,7 +110,10 @@ func accountRulePath(rule string, roots []string) string {
} }
rule = filepath.ToSlash(rule) rule = filepath.ToSlash(rule)
if !filepath.IsAbs(rule) { if !filepath.IsAbs(rule) {
return strings.Trim(rule, "/") // CHFS section rules are filesystem paths. Do not silently rebase a
// relative rule onto --path; the original parser treats such a value
// as a literal path and it therefore does not match a virtual path.
return rule
} }
for _, root := range roots { for _, root := range roots {
r := filepath.Clean(root) r := filepath.Clean(root)