summaryrefslogtreecommitdiff
path: root/cryptfs
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-11-03 22:25:29 +0100
committerJakob Unterwurzacher2015-11-03 22:25:29 +0100
commit050005fd7bd2bcdbb99f065e48f15283c5e1f7e2 (patch)
tree0b282a26cd90855e8c3462424d6be140d634f100 /cryptfs
parentb80167b39d0b0486b6a257bf378fadb3cfec65c2 (diff)
Centralize path filter decision in CryptFS.IsFiltered()
Diffstat (limited to 'cryptfs')
-rw-r--r--cryptfs/filter.go14
1 files changed, 14 insertions, 0 deletions
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
+}