"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
mailru: fix invalid timestamp on corrupted files (fixes #4229)
Ivan Andreev18c7549770d2
diff --git a/backend/mailru/api/m1.go b/backend/mailru/api/m1.goindex 91138d9a3..aba700a2f 100644--- a/backend/mailru/api/m1.go+++ b/backend/mailru/api/m1.go@@ -117,7 +117,7 @@ type ListItem struct {Name string `json:"name"`Home string `json:"home"`Size int64 `json:"size"`- Mtime int64 `json:"mtime,omitempty"`+ Mtime uint64 `json:"mtime,omitempty"`Hash string `json:"hash,omitempty"`VirusScan string `json:"virus_scan,omitempty"`Tree string `json:"tree,omitempty"`diff --git a/backend/mailru/mailru.go b/backend/mailru/mailru.goindex aeea7bc64..4d793933c 100644--- a/backend/mailru/mailru.go+++ b/backend/mailru/mailru.go@@ -656,9 +656,14 @@ func (f *Fs) itemToDirEntry(ctx context.Context, item *api.ListItem) (entry fs.Dif err != nil {return nil, -1, err}+ mTime := int64(item.Mtime)+ if mTime < 0 {+ fs.Debugf(f, "Fixing invalid timestamp %d on mailru file %q", mTime, remote)+ mTime = 0+ }switch item.Kind {case "folder":- dir := fs.NewDir(remote, time.Unix(item.Mtime, 0)).SetSize(item.Size)+ dir := fs.NewDir(remote, time.Unix(mTime, 0)).SetSize(item.Size)dirSize := item.Count.Files + item.Count.Foldersreturn dir, dirSize, nilcase "file":@@ -672,7 +677,7 @@ func (f *Fs) itemToDirEntry(ctx context.Context, item *api.ListItem) (entry fs.DhasMetaData: true,size: item.Size,mrHash: binHash,- modTime: time.Unix(item.Mtime, 0),+ modTime: time.Unix(mTime, 0),}return file, -1, nildefault: