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.
This commit is contained in:
Nick Craig-Wood
2026-07-30 17:50:08 +01:00
parent 74f9f182aa
commit 088f68f3c3
+1 -1
View File
@@ -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)