"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
crypt: fix compress wrapping crypt giving upload errors
Nick Craig-Wood430bf0d5eb65
diff --git a/backend/crypt/crypt.go b/backend/crypt/crypt.goindex 85972298e..1aece2753 100644--- a/backend/crypt/crypt.go+++ b/backend/crypt/crypt.go@@ -1047,10 +1047,11 @@ func (o *ObjectInfo) Hash(ctx context.Context, hash hash.Type) (string, error) {// Get the underlying object if there is oneif srcObj, ok = o.ObjectInfo.(fs.Object); ok {// Prefer direct interface assertion- } else if do, ok := o.ObjectInfo.(fs.ObjectUnWrapper); ok {- // Otherwise likely is an operations.OverrideRemote+ } else if do, ok := o.ObjectInfo.(*fs.OverrideRemote); ok {+ // Unwrap if it is an operations.OverrideRemotesrcObj = do.UnWrap()} else {+ // Otherwise don't unwrap any furtherreturn "", nil}// if this is wrapping a local object then we work out the hashdiff --git a/backend/crypt/crypt_internal_test.go b/backend/crypt/crypt_internal_test.goindex 825877630..07dee6ac5 100644--- a/backend/crypt/crypt_internal_test.go+++ b/backend/crypt/crypt_internal_test.go@@ -17,19 +17,6 @@ import ("github.com/stretchr/testify/require")-type testWrapper struct {- fs.ObjectInfo-}--// UnWrap returns the Object that this Object is wrapping or nil if it-// isn't wrapping anything-func (o testWrapper) UnWrap() fs.Object {- if o, ok := o.ObjectInfo.(fs.Object); ok {- return o- }- return nil-}-// Create a temporary local fs to upload things fromfunc makeTempLocalFs(t *testing.T) (localFs fs.Fs, cleanup func()) {@@ -83,7 +70,7 @@ func testObjectInfo(t *testing.T, f *Fs, wrap bool) {var oi fs.ObjectInfo = objif wrap {// wrap the object in an fs.ObjectUnwrapper if required- oi = testWrapper{oi}+ oi = fs.NewOverrideRemote(oi, "new_remote")}// wrap the object in a crypt for upload using the nonce we