aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorm4rc0d12026-02-09 18:39:55 +0100
committerJakob Unterwurzacher2026-02-10 21:38:04 +0100
commit5f5c34ac78cb9d1765ce9cabe87420c32f9d867e (patch)
tree03e076fd1186b264384e2f4a2c7f8559dc459df4
parentb024e3696d215e6b7a0b8d17ca3eb28af20dd504 (diff)
Fix issue with reverse mode and excluded virtual filesHEADmaster
This fixes #686. Now the `gocryptfs.longname.*.name` are present and readable in the reverse mount, regardless of the complexity of the exclusion patterns. The main issue was a `cPath` instead of `dPath` for the exclude check in `fusefrontend_reverse/node_helpers.go`. Also added a check to avoid the exclusion of `gocryptfs.conf` in the root directory. The test run results are in line with the main branch. Fixes https://github.com/rfjakob/gocryptfs/issues/686
-rw-r--r--internal/fusefrontend_reverse/node_helpers.go2
-rw-r--r--internal/fusefrontend_reverse/root_node.go4
2 files changed, 4 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/node_helpers.go b/internal/fusefrontend_reverse/node_helpers.go
index 3165db6..f733689 100644
--- a/internal/fusefrontend_reverse/node_helpers.go
+++ b/internal/fusefrontend_reverse/node_helpers.go
@@ -134,7 +134,7 @@ func (n *Node) lookupLongnameName(ctx context.Context, nameFile string, out *fus
if errno != 0 {
return
}
- if rn.isExcludedPlain(filepath.Join(d.cPath, pName)) {
+ if rn.isExcludedPlain(filepath.Join(d.pPath, pName)) {
errno = syscall.EPERM
return
}
diff --git a/internal/fusefrontend_reverse/root_node.go b/internal/fusefrontend_reverse/root_node.go
index 420ed22..1a668af 100644
--- a/internal/fusefrontend_reverse/root_node.go
+++ b/internal/fusefrontend_reverse/root_node.go
@@ -13,6 +13,7 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
+ "github.com/rfjakob/gocryptfs/v2/internal/configfile"
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/internal/exitcodes"
"github.com/rfjakob/gocryptfs/v2/internal/fusefrontend"
@@ -136,7 +137,8 @@ func (rn *RootNode) findLongnameParent(fd int, diriv []byte, longname string) (p
// excluded (used when -exclude is passed by the user).
func (rn *RootNode) isExcludedPlain(pPath string) bool {
// root dir can't be excluded
- if pPath == "" {
+ // Don't exclude gocryptfs.conf too
+ if pPath == "" || pPath == configfile.ConfReverseName {
return false
}
return rn.excluder != nil && rn.excluder.MatchesPath(pPath)