From 9c858c3228f77a9402ac6589910dba161112083c Mon Sep 17 00:00:00 2001 From: buengese Date: Tue, 21 Jan 2020 22:32:34 +0100 Subject: [PATCH] crypt: correctly handle trailing dot --- backend/crypt/crypt.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/crypt/crypt.go b/backend/crypt/crypt.go index 56d9cabf5..eabb2623e 100644 --- a/backend/crypt/crypt.go +++ b/backend/crypt/crypt.go @@ -5,6 +5,7 @@ import ( "context" "fmt" "io" + "path" "strings" "time" @@ -144,6 +145,10 @@ func NewFs(name, rpath string, m configmap.Mapper) (fs.Fs, error) { if err != nil { return nil, errors.Wrapf(err, "failed to parse remote %q to wrap", remote) } + // Make sure to remove trailing . reffering to the current dir + if path.Base(rpath) == "." { + rpath = strings.TrimSuffix(rpath, ".") + } // Look for a file first remotePath := fspath.JoinRootPath(wPath, cipher.EncryptFileName(rpath)) wrappedFs, err := wInfo.NewFs(wName, remotePath, wConfig)