From 088f68f3c324744ddf508455e3b3a07699a7ae50 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 30 Jul 2026 17:38:08 +0100 Subject: [PATCH] smb: fix server-side move of directories with special characters in the name - fixes #9677 DirMove checked whether the destination exists using the raw path but performed the rename with the encoded path, so for directory names needing encoding (trailing spaces or periods, characters like \* ? : < > | " or a literal backslash) the existence check looked at a different server path than the rename used. --- backend/smb/smb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/smb/smb.go b/backend/smb/smb.go index afb730332..13d800501 100644 --- a/backend/smb/smb.go +++ b/backend/smb/smb.go @@ -438,7 +438,7 @@ func (f *Fs) DirMove(ctx context.Context, src fs.Fs, srcRemote, dstRemote string } defer f.putConnection(&cn, err) - _, err = cn.smbShare.Stat(dstPath) + _, err = cn.smbShare.Stat(f.toSambaPath(dstPath)) if os.IsNotExist(err) { err = cn.smbShare.Rename(f.toSambaPath(srcPath), f.toSambaPath(dstPath)) return translateError(err, true)