From 9a64413b1b9b38cd9ff520983cf5e79965b4a195 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 10 Jul 2024 00:01:41 +0100 Subject: [PATCH] Revert "onedrive: make server-side copy to work in more scenarios" This reverts commit f68d962c863b990b627f3283497d820332d03ec9. --- backend/onedrive/onedrive.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index abdffdf1c..a356367e7 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -213,11 +213,9 @@ listing, set this option.`, Allow server-side operations (e.g. copy) to work across different onedrive configs. -This will work if you are copying between two OneDrive *Personal* drives AND the files to -copy are already shared between them. Additionally, it should also function for a user who -has access permissions both between Onedrive for *business* and *SharePoint* under the *same -tenant*, and between *SharePoint* and another *SharePoint* under the *same tenant*. In other -cases, rclone will fall back to normal copy (which will be slightly slower).`, +This will only work if you are copying between two OneDrive *Personal* drives AND +the files to copy are already shared between them. In other cases, rclone will +fall back to normal copy (which will be slightly slower).`, Advanced: true, }, { Name: "list_chunk", @@ -1611,12 +1609,14 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, fs.Debugf(src, "Can't copy - not same remote type") return nil, fs.ErrorCantCopy } - - if (f.driveType == driveTypePersonal && srcObj.fs.driveType != driveTypePersonal) || (f.driveType != driveTypePersonal && srcObj.fs.driveType == driveTypePersonal) { - fs.Debugf(src, "Can't server-side copy - cross-drive between OneDrive Personal and OneDrive for business (SharePoint)") + if f.driveType != srcObj.fs.driveType { + fs.Debugf(src, "Can't server-side copy - drive types differ") return nil, fs.ErrorCantCopy - } else if f.driveType == driveTypeBusiness && srcObj.fs.driveType == driveTypeBusiness && srcObj.fs.driveID != f.driveID { - fs.Debugf(src, "Can't server-side copy - cross-drive between difference OneDrive for business (Not SharePoint)") + } + + // For OneDrive Business, this is only supported within the same drive + if f.driveType != driveTypePersonal && srcObj.fs.driveID != f.driveID { + fs.Debugf(src, "Can't server-side copy - cross-drive but not OneDrive Personal") return nil, fs.ErrorCantCopy }