From 050005fd7bd2bcdbb99f065e48f15283c5e1f7e2 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 3 Nov 2015 22:25:29 +0100 Subject: Centralize path filter decision in CryptFS.IsFiltered() --- cryptfs/filter.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 cryptfs/filter.go (limited to 'cryptfs') diff --git a/cryptfs/filter.go b/cryptfs/filter.go new file mode 100644 index 0000000..079b64f --- /dev/null +++ b/cryptfs/filter.go @@ -0,0 +1,14 @@ +package cryptfs + +// IsFiltered - check if "path" should be forbidden +// +// Used to prevent name clashes with gocryptfs.conf +// when file names are not encrypted +func (be *CryptFS) IsFiltered(path string) bool { + // gocryptfs.conf in the root directory is forbidden + if be.plaintextNames == true && path == "gocryptfs.conf" { + Warn.Printf("The name \"/gocryptfs.conf\" is reserved when \"--plaintextnames\" is used\n") + return true + } + return false +} -- cgit v1.2.3