From 00bf40a8ef4e52f3f4e3f9c54996bdea5033f5ed Mon Sep 17 00:00:00 2001 From: Cnly Date: Wed, 6 Jan 2021 02:57:51 +0800 Subject: [PATCH] onedrive: fix server-side copy completely disabled on OneDrive for Business This fixes a little problem in PR #4903, which is a fix for #4342 --- backend/onedrive/onedrive.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index 10a06dfd6..6a8c2e78e 100755 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -1032,7 +1032,13 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object, return nil, fs.ErrorCantCopy } if f.driveType != srcObj.fs.driveType { - fs.Debugf(src, "Can't server-side copy - not both drives are OneDrive Personal") + fs.Debugf(src, "Can't server-side copy - drive types differ") + return nil, fs.ErrorCantCopy + } + + // 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 }