diff --git a/chfs-ng/cmd/chfs/main.go b/chfs-ng/cmd/chfs/main.go index a83d0d7..3c211bd 100644 --- a/chfs-ng/cmd/chfs/main.go +++ b/chfs-ng/cmd/chfs/main.go @@ -110,7 +110,10 @@ func accountRulePath(rule string, roots []string) string { } rule = filepath.ToSlash(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 { r := filepath.Clean(root)