"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
smb: fix panic if stat fails
Nick Craig-Woodc9e5f45d73ba
diff --git a/backend/smb/smb.go b/backend/smb/smb.goindex 37ac06554..ff8f40976 100644--- a/backend/smb/smb.go+++ b/backend/smb/smb.go@@ -601,9 +601,10 @@ func (o *Object) SetModTime(ctx context.Context, t time.Time) (err error) {}fi, err := cn.smbShare.Stat(reqDir)- if err == nil {- o.statResult = fi+ if err != nil {+ return fmt.Errorf("SetModTime: stat: %w", err)}+ o.statResult = fireturn err}@@ -685,7 +686,6 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, opreturn err}defer func() {- o.statResult, _ = cn.smbShare.Stat(filename)o.fs.putConnection(&cn)}()@@ -723,7 +723,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, opreturn fmt.Errorf("Update Close failed: %w", err)}- // Set the modified time+ // Set the modified time and also o.statResulterr = o.SetModTime(ctx, src.ModTime(ctx))if err != nil {return fmt.Errorf("Update SetModTime failed: %w", err)