You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: leave unicode normalizations in paths untouched (#12039)
* fix: bypass Qt's QFile::encodeName() in csync
* Move decode name methods to the `OCC::FileSystem` namespace
* Use custom mkpath to ensure no normalization is done on names
* Stop the socket API from normalizing file names
* fix: implement FakeFolder::fromDisk using csync functions to bypass QFile::encodeName()
* Use `std::filesystem::rename` on non-Windows systems
To prevent `QFile::rename` doing normalization changes to the file name.
* Add file/dir name normalization test
Check that a file/directory name with NFC encoding on the server ends up
with the same encoding on the client, and that a subsequent
discovery+sync will not upload differently encoded files. Same for an
NFD encoded file/directory name.
* Fix mkpath
---------
Co-authored-by: Erik Verbruggen <[email protected]>
done(SyncFileItem::NormalError, tr("Can not create local folder %1 because of a local file name clash with %2").arg(newDirStr, QDir::toNativeSeparators(clash.get())));
179
179
return;
180
180
}
181
-
QDir localDir(propagator()->localPath());
182
-
if (!localDir.mkpath(_item->_file)) {
181
+
182
+
if (!FileSystem::mkpath(propagator()->localPath(), _item->_file)) {
183
183
done(SyncFileItem::NormalError, tr("could not create folder %1").arg(newDirStr));
// If the normalization of the file/directory name did not change, no rename/move/etc. should have been detected, so check that the client didn't issue
304
+
// any of these operations:
305
+
QCOMPARE(counter.nDELETE, 0);
306
+
QCOMPARE(counter.nMOVE, 0);
307
+
QCOMPARE(counter.nPUT, 0);
308
+
309
+
// Check that the remote names are unchanged, and that no "incorrect" names have been introduced:
0 commit comments