summaryrefslogtreecommitdiff
path: root/cryptfs/cryptfs_names.go
diff options
context:
space:
mode:
Diffstat (limited to 'cryptfs/cryptfs_names.go')
-rw-r--r--cryptfs/cryptfs_names.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/cryptfs/cryptfs_names.go b/cryptfs/cryptfs_names.go
index 5476b17..a7a9a8c 100644
--- a/cryptfs/cryptfs_names.go
+++ b/cryptfs/cryptfs_names.go
@@ -102,14 +102,20 @@ func (be *CryptFS) translatePath(path string, op bool) (string, error) {
return strings.Join(translatedParts, "/"), err
}
-// EncryptPath - encrypt filename or path. Just hands it to TranslatePath().
+// EncryptPath - encrypt filename or path. Just hands it to translatePath().
func (be *CryptFS) EncryptPath(path string) string {
+ if be.plaintextNames {
+ return path
+ }
newPath, _ := be.translatePath(path, ENCRYPT)
return newPath
}
-// DecryptPath - decrypt filename or path. Just hands it to TranslatePath().
+// DecryptPath - decrypt filename or path. Just hands it to translatePath().
func (be *CryptFS) DecryptPath(path string) (string, error) {
+ if be.plaintextNames {
+ return path, nil
+ }
return be.translatePath(path, DECRYPT)
}