From 0bc97845087b1e426d8cb2cb9c36779c4f9b2671 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 18 Aug 2021 11:33:12 +0200 Subject: reverse: fix "exclude all but" case With test. Fixes https://github.com/rfjakob/gocryptfs/issues/588 --- internal/fusefrontend_reverse/root_node.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'internal/fusefrontend_reverse') 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) } -- cgit v1.2.3