From 7c911bf2d6ddeadfb79a87bd1cb304bc58dd446e Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 18 Aug 2018 19:05:32 +0100 Subject: [PATCH] b2: fix app key support on upload to a bucket - fixes #2428 --- backend/b2/b2.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 4502aac8b..1908fca25 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -318,6 +318,11 @@ func NewFs(name, root string, m configmap.Mapper) (fs.Fs, error) { if err != nil { return nil, errors.Wrap(err, "failed to authorize account") } + // If this is a key limited to a single bucket, it must exist already + if f.bucket != "" && f.info.Allowed.BucketID != "" { + f.markBucketOK() + f.setBucketID(f.info.Allowed.BucketID) + } if f.root != "" { f.root += "/" // Check to see if the (bucket,directory) is actually an existing file