summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-18 11:33:12 +0200
committerJakob Unterwurzacher2021-08-18 11:38:56 +0200
commit0bc97845087b1e426d8cb2cb9c36779c4f9b2671 (patch)
treec771313a40dca57fed437cba9ca01a21ede79d0a /internal
parent3df1c624301bca215a300c2b9b9135c3966950f9 (diff)
reverse: fix "exclude all but" case
With test. Fixes https://github.com/rfjakob/gocryptfs/issues/588
Diffstat (limited to 'internal')
-rw-r--r--internal/fusefrontend_reverse/root_node.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/fusefrontend_reverse/root_node.go b/internal/fusefrontend_reverse/root_node.go
index d57e1e6..5ce7f81 100644
--- a/internal/fusefrontend_reverse/root_node.go
+++ b/internal/fusefrontend_reverse/root_node.go
@@ -109,6 +109,10 @@ func (rn *RootNode) findLongnameParent(fd int, diriv []byte, longname string) (p
// isExcludedPlain finds out if the plaintext path "pPath" is
// excluded (used when -exclude is passed by the user).
func (rn *RootNode) isExcludedPlain(pPath string) bool {
+ // root dir can't be excluded
+ if pPath == "" {
+ return false
+ }
return rn.excluder != nil && rn.excluder.MatchesPath(pPath)
}