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:
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user