Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

b2: fix app key support on upload to a bucket - fixes #2428

Nick Craig-Wood7c911bf2d6dd
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